LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 293
Default One Variable Available In Three Workbooks

Hey Gary,

Thanks for the reply.

I'm afraid I may not have made the situation clear,

I need to declare the workbook names as variables when the first
workbook is opened and have these variables available in the other two
workbooks without redeclaring them. I know I can declare them as
Global but they are global only in the workbook that they are declared
in and not in the other two workbooks regardless of the order the
workbooks are opened in. I need these variables available in the
worksheet code section, the workbook open event and in the UserForm
code section.

Unfortunately, this code cannot do that.

Does anyone know of a way to make a truly global variable for workbook
names?

Any help would be appreciated.

-Minitman



On Fri, 5 Sep 2008 21:00:22 -0400, "Gary Keramidas"
<GKeramidasATmsn.com wrote:

maybe something like this, just change the names as necessary:

Dim file2 As String
Dim fpath As String
Dim wb2 As Workbook

file2 = "book1.xls"
fpath = ThisWorkbook.Path & "\"
Set wb2 = Workbooks.Open(fpath & file2, ReadOnly:=True)


 
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 Link to Workbooks dfrancefort Excel Worksheet Functions 1 April 28th 05 01:15 AM
Workbooks with variable names bpmccoy Excel Programming 2 November 22nd 04 10:13 AM
Use variable across workbooks Steph[_3_] Excel Programming 2 September 29th 04 01:12 PM
Passing a variable between workbooks Rich Cooper Excel Programming 1 May 19th 04 07:27 PM
How to refer a Variable across Workbooks ? Prabhu Dev Excel Programming 1 November 27th 03 05:22 AM


All times are GMT +1. The time now is 02:02 PM.

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"