Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variable available to all open xl files
Is there a way to declare a variable that will be recognized by open excel
files? For example if I have 2 files and in File1 I set a variable vAllFilesVariable = "It works" then if I am in File2 and put MsgBox vAllFilesVariable on the SelectionChange is there a way to make it so it would return the variable? Thank you, Steven |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Variable available to all open xl files
hi, Steven !
Is there a way to declare a variable that will be recognized by open excel files? For example if I have 2 files and in File1 I set a variable vAllFilesVariable = "It works" then if I am in File2 and put MsgBox vAllFilesVariable on the SelectionChange is there a way to make it so it would return the variable? without linked references between vba-projects ?... (one way) File1 (the file with the variable) - standard code module: Public vAllFilesVariable As String Function WhatsOnMyVariable() As Variant WhatsOnMyVariable = vAllFilesVariable End Function - workbook_open event Private Sub Workbook_Open() vAllFilesVariable = "It Works !!!" End Sub File_X - standard code module Sub VariableOtherWorkbook() MsgBox Application.Run("file1.xls!whatsonmyvariable") End Sub hth, hector. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Open files with a variable name in a folder get name in B1 and sav | Excel Programming | |||
How to change default Open/Files of Type to "Microsoft Excel Files | Excel Discussion (Misc queries) | |||
HOW TO GET OVER WITH THIS ANNOYING LINKED FILES MSG BOX WHEN I OPEN FILES WHICH HAS LINKS | Excel Programming | |||
Macro to open *.dat files and save as .txt (comma delimited text files) | Excel Programming | |||
Using a variable name as part of a file pathname to open many files | Excel Programming |