Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
= How to setup vars when a workbookopen event is launched?
I need to setup some variables in my VBA code before the program starts. I
think one could to include this setup in the Workbook_Open event, before the worksheet be loaded. How Can I do this? Second: does VBA support "Typed Constants" like Delphi or C? For example I would like to initialize a global (public) boolean var called FirstTime as True, so when the first macro code starts running it has this True value by default. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
= How to setup vars when a workbookopen event is launched?
Create this variable in a standard code module
Public FirstTime As Boolean In the Thisworkbook class modujle add Private Sub Workbook_Open() FirstTime = True End Sub -- HTH RP "hcova" wrote in message ... I need to setup some variables in my VBA code before the program starts. I think one could to include this setup in the Workbook_Open event, before the worksheet be loaded. How Can I do this? Second: does VBA support "Typed Constants" like Delphi or C? For example I would like to initialize a global (public) boolean var called FirstTime as True, so when the first macro code starts running it has this True value by default. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
workbookopen doesn't function | Excel Discussion (Misc queries) | |||
Can you tell how Excel is launched? | Excel Programming | |||
WorkbookOpen event unpredictable | Excel Programming | |||
Global vars | Excel Programming | |||
WorkbookOpen | Excel Programming |