I have tried all the different versions I have seen on the boards, and still am getting a Compile Error: Expected End of Statement error.
Here is the setup
File 1: Macros.xlsm - which has macros in it to be run on other files
File 2: TG.xls - which I want to run the macros on. [yes, the old file is in compatability mode, I thought I would include this, as it may be relevant]
File1 Macro: Sub RunUpdates
-calls multiple sub routines for different updates to be stepped through.
File 2 Macro: UnhideCY (in Module modTGFinancials_Upd_2014, not a sheet module)
-is a macro within the target file, that unhides some of the sheets for updates. Because the CY sheets are renamed in each file, I wrote the macro using the sheet codename, and will put the macro into each file that needs the updates. (There are 240+files for updating.)
I would like to have in Sub RunUpdates a call out to UnhideCY, but have not been able to get any of the following to work:
Application.Run "'"&Application.ActiveWorkbook.Name&"'!modTGFinancials_Upd_2014.UnhideCY"
Application.Run "'"&Applicaton.ActiveWorkbook.Name&"'!UnhideCY"
Application.Run "'"&wbTG&"'!.UnhideCY" [where wbTG=activeworkbook, or the TG file]
I know I have not captured all the ways I have tried to make this work. And unfortunately, do not feel that I have explained well, or can explain better. (I have been working on this for 5 hours now, and think I am VBA drunk.)
Someone with fresh eyes who may see the error of my ways, would be greatly appreciated.
Here is the setup
File 1: Macros.xlsm - which has macros in it to be run on other files
File 2: TG.xls - which I want to run the macros on. [yes, the old file is in compatability mode, I thought I would include this, as it may be relevant]
File1 Macro: Sub RunUpdates
-calls multiple sub routines for different updates to be stepped through.
File 2 Macro: UnhideCY (in Module modTGFinancials_Upd_2014, not a sheet module)
-is a macro within the target file, that unhides some of the sheets for updates. Because the CY sheets are renamed in each file, I wrote the macro using the sheet codename, and will put the macro into each file that needs the updates. (There are 240+files for updating.)
I would like to have in Sub RunUpdates a call out to UnhideCY, but have not been able to get any of the following to work:
Application.Run "'"&Application.ActiveWorkbook.Name&"'!modTGFinancials_Upd_2014.UnhideCY"
Application.Run "'"&Applicaton.ActiveWorkbook.Name&"'!UnhideCY"
Application.Run "'"&wbTG&"'!.UnhideCY" [where wbTG=activeworkbook, or the TG file]
I know I have not captured all the ways I have tried to make this work. And unfortunately, do not feel that I have explained well, or can explain better. (I have been working on this for 5 hours now, and think I am VBA drunk.)
Someone with fresh eyes who may see the error of my ways, would be greatly appreciated.