Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm having trouble accessing a public variable in a module when this
public variable is declared in another module. Here's my situation where I have 2 forms and 2 modules: form1 form2 module1 Public TWB As Object load form1 ' works fine module2 load form2 ' TWB is Nothing The TWB public variable is Set in the Auto_Open() (actually in another module) so it is always set. Both form1 and form2 reference TWB in their form initialization but TWB shows up as set to Nothing when form2 is loaded in module2. However, if I move the Public statement from module1 to module2 then loading form2 works fine. So what am I doing wrong? Supposedly public variables are accessible across all modules in the same project and I'm not using any 'option private module.' Denis |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Public variable | Excel Programming | |||
Public, Private, Event modules, Forms modules,,, | Excel Programming | |||
Problem accessing Oracle Public Synonyms from Microsoft Excel 2002 | Excel Discussion (Misc queries) | |||
Public Variable | Excel Programming | |||
Accessing AddIn Class Modules from Client Worksheet | Excel Programming |