JTL9161
Well-known Member
- Joined
- Aug 29, 2012
- Messages
- 591
- Office Version
- 365
- Platform
- Windows
I have the below code at the end of a macro after switching from workbook (A) to the MMDDYY-SGCS workbook. The entire macro runs in WB(A) then the code below switches to the MMDDYY workbook.
Windows("MMDDYY-SGCS.xlsm").Activate
Sheets("Sheet1").Select
Range("B2").Select
'Application.Run "MMDDYY-SGCS.xlsm!SGPDNORX"
Application.Run Application.ActiveWorkbook.Name & "SGPDNORX"
End Sub
I have tried both Application.Run's listed here (disabling one of them each time) and ever time I get the
Runtime Error 1004' Cannot run the macro "SGPDNORX" The macro may not be available in this workbook or all macros may be disabled."
I have checked the spelling and even did a recorded macro to get the exact code needed and still the same error.
Any help appreciated.
James
Windows("MMDDYY-SGCS.xlsm").Activate
Sheets("Sheet1").Select
Range("B2").Select
'Application.Run "MMDDYY-SGCS.xlsm!SGPDNORX"
Application.Run Application.ActiveWorkbook.Name & "SGPDNORX"
End Sub
I have tried both Application.Run's listed here (disabling one of them each time) and ever time I get the
Runtime Error 1004' Cannot run the macro "SGPDNORX" The macro may not be available in this workbook or all macros may be disabled."
I have checked the spelling and even did a recorded macro to get the exact code needed and still the same error.
Any help appreciated.
James