D
Dkline
I want to create a Public variable upon the opening or reactivation of a
workbook.
Public wbVLA08 = Application.ActiveWorkbook
Then at various points in several modules I activate a different workbook,
do something there, and then want to make sure the original workbook is
activated. So I'd use:
wbVLA08.Activate
When a routine is called by another macro in which the Public variable has
been set, I get flagged on it saying object hasn't been set. "Run-time error
91: Object variable or With block variable not set"
Do I need to declare the variable in every module in which it is used? Do I
need to set in each module? Do I need to make it static?
If I understand it, I can't set in "This Workbook" which is what I'd like to
do.
How can I do this?
workbook.
Public wbVLA08 = Application.ActiveWorkbook
Then at various points in several modules I activate a different workbook,
do something there, and then want to make sure the original workbook is
activated. So I'd use:
wbVLA08.Activate
When a routine is called by another macro in which the Public variable has
been set, I get flagged on it saying object hasn't been set. "Run-time error
91: Object variable or With block variable not set"
Do I need to declare the variable in every module in which it is used? Do I
need to set in each module? Do I need to make it static?
If I understand it, I can't set in "This Workbook" which is what I'd like to
do.
How can I do this?