Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Name Scope | Excel Worksheet Functions | |||
Set Public Variable on Open | Excel Discussion (Misc queries) | |||
Public variable | New Users to Excel | |||
public variable | Excel Programming | |||
Scope of variable includes all Form _and_ Code modules?? | Excel Programming |