Irish_Griffin
Board Regular
- Joined
- Jan 16, 2009
- Messages
- 138
Hi Everyone,
Here is an interesting problem.
Within VBA, I want to open an existing workbook and call/run macros found in this newly opened workbook.
With searching, I found the following code to run a macro from a different workbook :
My problem is this :
I need to pass variables into the macro found in the other workbook
thus the following code does not work :
Is there a solution ???
Many Thanks,
Griff
Here is an interesting problem.
Within VBA, I want to open an existing workbook and call/run macros found in this newly opened workbook.
With searching, I found the following code to run a macro from a different workbook :
Code:
Dim File_Path as string
Dim File_Name as string
File_Path = "C:\test.xls"
File_Name = "test.xls"
Workbooks.OpenText Filename:=File_Path
Application.Run File_Name & "!macro_name_here"
My problem is this :
I need to pass variables into the macro found in the other workbook
thus the following code does not work :
Code:
Application.Run File_Name & "!macro_name_here(string_var, boolean_var)"
Is there a solution ???
Many Thanks,
Griff