Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Question about variable scope

Was caught out with the following:
..xla add-in with a public Boolean variable declared in a normal module.
This public variable is set by running a Sub in another normal module
on opening the add-in, so this Sub was run from Private Sub Workbook_Open()
This public variable got set fine to True, but by the time it was needed in
another
normal module it had reset to False.
Is this normal behaviour because the Public declaration happens after the
Workbook
Open event? But then if this is the case why is there no error when the
variable gets
set in the Sub that runs on the Workbook Open event?
Thanks for any insight in this.

RBS

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
variable scope mgasparel Excel Programming 2 February 16th 05 05:22 PM
Variable Scope Kevin Excel Programming 1 September 14th 04 07:05 PM
Variable scope TonyM Excel Programming 5 April 24th 04 01:02 PM
Variable scope question w/combo-box, 2ND try Tim Coddington Excel Programming 2 December 20th 03 04:07 AM
Variable scope question w/combo-box Tim Coddington Excel Programming 4 December 17th 03 02:38 AM


All times are GMT +1. The time now is 08: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"