Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Variable Link to Workbooks | Excel Worksheet Functions | |||
Workbooks with variable names | Excel Programming | |||
Use variable across workbooks | Excel Programming | |||
Passing a variable between workbooks | Excel Programming | |||
How to refer a Variable across Workbooks ? | Excel Programming |