Re: Public variable

Tech-Archive recommends: Fix windows errors by optimizing your registry



Thanks Jim, I got it to work...

"Jim Cone" <jim.coneXXX@xxxxxxxxxx> wrote in message
news:%23IRw4VRaHHA.4772@xxxxxxxxxxxxxxxxxxxxxxx

Eric,
1. An Auto_Open sub must be in a standard module, not in the
ThisWorkbook module or a *** module.
2. If you are opening the workbook using code then any Auto_xxx
subs will not run. Your have to use the RunAutoMacros method.
3. The public declaration of the variable should be in standard module.
4. The Workbook_Open event sub could also be used to initialize the
variable.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Eric" <eric@xxxxxxxxx>
wrote in message
Hello,
I am setting up a public variable in the declaration section of my module
(Public Authorized_Machine as string)
I initialize the variable right in the Auto_open() sub expecting ths
variable and its value to be available to all the procedures in my
module,
but it does not work.
A simple "MsgBox Authorized_Machine" (in a seperate procedure) shows the
variable empty...
What am I doing wrong?
Thank you.
Eric




.


Quantcast