Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Globals set to nothing

I've got a couple of global variables in a public module. They are
instances of classes. On Workbook_Open, I run a public sub InitGlobals
which sets them good values.

Everything's fine so far. The instance variables are responsible for
busisness logic and communication with a a database. They also are the
event handlers for the controls on the sheets. Everything was running
swimmingly until this morning. I show a user form, run a sub based on
the user form, and when the sub ends, all of my globals are set to
Nothing. No idea why.

Anyone else experience anything similar? I've googled, and all I've
come up with is 'Convert it to an XLA and the problem goes away, but I
don't want to do that at this point.

Thanks

Jim

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Globals set to nothing

One thing to look for is to ensure that you are not using "End" as a stand
alone line of code something like this

if x=y then
End 'Problem here
end if

or

if x=y then End

end clears all globally declared varaibles...
--
HTH...

Jim Thomlinson


"fijimf" wrote:

I've got a couple of global variables in a public module. They are
instances of classes. On Workbook_Open, I run a public sub InitGlobals
which sets them good values.

Everything's fine so far. The instance variables are responsible for
busisness logic and communication with a a database. They also are the
event handlers for the controls on the sheets. Everything was running
swimmingly until this morning. I show a user form, run a sub based on
the user form, and when the sub ends, all of my globals are set to
Nothing. No idea why.

Anyone else experience anything similar? I've googled, and all I've
come up with is 'Convert it to an XLA and the problem goes away, but I
don't want to do that at this point.

Thanks

Jim


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"