View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
PeteCresswell[_2_] PeteCresswell[_2_] is offline
external usenet poster
 
Posts: 56
Default Globals Go "Poof!": Workarounds?

In Workbook_Open() I'm capturing a couple of global variable values:
the workbook's name, and it's full path.

Naturally, when code is interrupted, the globals go "Poof!".

This is expected.... but I'm unable to make Workbook_Open a public
routine and call it as needed.

Seems like I need an alternative to global variables.

First thing that comes to mind is an invisible "System" or
"Application" worksheet that gets populated by Workbook_Open. Then I
write a couple of functions to grab the desired values from that
invisible sheet.

Does this sound like good practice?

Alternatives?