public variable handling in visual basic

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi world
I am using public variables defined and initialized in a modul
I run either via the Auto_open maro or in the ThisWorkbook.open() event procedure
But as soon as I enter the debugger in any module of my application and make any actio
that leads me to stop and restart the module, ALL public variables are LOST and I must exi
and restart the whole application to restore the publics
Could anyone tell me how to restore public variables from the debugger without having to
restart the application
Thanks for your suggestions.
 
Hi,

I don't think you can save any public variables once you
stop a process - why would they not be destroyed when
you stop? They are volatile with all your other local
variables - gone as soon as you stop processing.

sorry.
jeff
-----Original Message-----
Hi world !
I am using public variables defined and initialized in a module
I run either via the Auto_open maro or in the
ThisWorkbook.open() event procedure.
But as soon as I enter the debugger in any module of my
application and make any action
that leads me to stop and restart the module, ALL public
variables are LOST and I must exit
and restart the whole application to restore the publics !
Could anyone tell me how to restore public variables
from the debugger without having to
 
if you have an initialization subroutine, just run that (again).

Maybe just running auto_open would do it for you, too.

(Both depend on what else you do in those routines.)
 
Hi Dave !
Thanks for your reply to my trhead.
I now know with Jeff's argumentation that my goal, to make
public variables allway available from within visual bacic debugger
is not realizable : I was seeing my root-workbook as "holder" of my public objects
and therefore thinking that those publics should be alive until the root-workbook is closed
but that is unfortunatly not true !
If I still need to achive that goal, I cann reorganize my auto_open routine as you mentioned to isolate the
code that defines and initializes the public objects in order to be able to run only that code any time after
the debugger stops.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top