Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Declare Variable


Hola Todos ! I need some help. I want to declare some variables for al
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 m
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 m

--
zapatista6

-----------------------------------------------------------------------
zapatista66's Profile: http://www.excelforum.com/member.php...fo&userid=1195
View this thread: http://www.excelforum.com/showthread.php?threadid=26698

  #2   Report Post  
Posted to microsoft.public.excel.programming
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

.

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
Declare an Array() ???? Andoni[_23_] Excel Programming 1 August 31st 04 07:12 PM
How to declare variable as Excel constant? John Wirt[_6_] Excel Programming 2 August 22nd 04 05:41 PM
How do i declare a formula with prenamed variable Jeff Excel Programming 1 June 25th 04 06:09 PM
Best place to declare variables Taras Excel Programming 7 November 27th 03 04:34 PM
declare type and value on one line? Jamie Martin[_2_] Excel Programming 4 October 1st 03 01:42 PM


All times are GMT +1. The time now is 03:08 AM.

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

About Us

"It's about Microsoft Excel"