View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Geof Wyght[_2_] Geof Wyght[_2_] is offline
external usenet poster
 
Posts: 38
Default Declare Variable

Zapatista66,
You're almost there. In your Workbook_Open procedure call
another public procedure that I call SetRefs. SetRefs has
all of your Set statements and you make the all of the
objects global in scope. Then your other procs will see
the objects.
Also, while testing a procedure, throw SetRefs into the
top of the procedure so when you get a runtime error you
don't have to go look for Workbook_Open or SetRefs again.
Just fix your code and F5.
Geof.
-----Original Message-----

Hola Todos ! I need some help. I want to declare some

variables for all
my modules.

Ex:

Public wbBook1 as workbook, wbBook2, etc

Set wbBook1 = workbooks("roger.xls")

I don't want to write these lines in each modules. Want I

start my
principal workbook I open all workbooks needed in my

programmation.
After, I look in some workbook and I write in the other.

thanks for helping me


--
zapatista66


----------------------------------------------------------

--------------
zapatista66's Profile:

http://www.excelforum.com/member.php?
action=getinfo&userid=11956
View this thread:

http://www.excelforum.com/showthread...hreadid=266983

.