Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think you should rewrite your code so that you don't use that End statement
(not end with, not end if--just the plain old End). Then your static variables will still hold their values. On the other hand, lots of things can go wrong. I would include a routine that would repopulate those variables. Add one more public/static variable: Public VariablesAreInitialized as boolean Then later you can use: if variablesareinitialized then 'keep going else call dedicatedroutinetoinitializevariables 'not rely on Auto_open end if sub dedicatedroutinetoinitializevariables() set TWB = somethingoranother ...all you need variablesareinitialized = true end sub just in case something unexpected goes wrong. (or if twb is nothing then call dedicatedroutinetoinitializevariables end if OlieH wrote: I auto_open a macro, set variables then exit the mcro to allow users to directly enter values in the worksheet. When they are through they press a button that reactivates the aarco. My problem is the variablest that I have set are lost. Is there a way to save these variables. I currently save then in portion of a work sheet the user does not see. I would like a better way. thanks for the help OlieH -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there some 'secret' to getting 'End' to work when stopping func | Excel Worksheet Functions | |||
How do I remove the 'end' function in Excel 2003? | Excel Worksheet Functions | |||
Save button, VBA protected, allow user to define where to save | Excel Programming | |||
prompt user to save file as {desired_name} and save it to a variab | Excel Programming | |||
VSB code - 'Home' & 'CTRL+End' | Excel Discussion (Misc queries) |