View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
GB GB is offline
external usenet poster
 
Posts: 230
Default Setting Public Variables Error

Yes.. If you put the call to "set" your variables in your ThisWorkbook
section when opening the document, then the variables should be set.
However, I think that I have seen instances where the values get "corrupted"
or lost. I typically use a module that contains a series of functions that
return the value I want "globally" set. I did this after I ran into a
problem of Excel not being able to maintain a global list of variables on the
order of 30 or something.. Or if the program errored, then the variable
values were lost. That way I had everything I needed stored in one place,
and I could put my eyes on the value if I needed to review it, and not hunt
down where I had implemented my global value(s).


"clmarquez" wrote:


Thanks guys. I understand now. I just thought that if these were going
to be set to the same thing, that I could somehow "globally" set them,
and not worry about having to re-set them in each individual macro.

Instead of setting them in each individual macro, could they somehow be
"globally" set once somewhere else outside of public declarations?
Maybe in Workbook or something? Or, do you advise against it?


--
clmarquez
------------------------------------------------------------------------
clmarquez's Profile: http://www.excelforum.com/member.php...o&userid=29386
View this thread: http://www.excelforum.com/showthread...hreadid=501145