Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default = 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default = 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
workbookopen doesn't function P Westerman via OfficeKB.com Excel Discussion (Misc queries) 0 February 6th 05 05:13 PM
Can you tell how Excel is launched? Gail Hurn Excel Programming 3 January 11th 05 05:47 PM
WorkbookOpen event unpredictable JT[_5_] Excel Programming 0 September 21st 04 12:47 PM
Global vars Nath Excel Programming 1 July 13th 04 04:20 PM
WorkbookOpen James[_14_] Excel Programming 2 January 30th 04 03:26 PM


All times are GMT +1. The time now is 11:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"