paun_shotts
New Member
- Joined
- Nov 4, 2021
- Messages
- 41
- Office Version
- 2013
- Platform
- Windows
Hi,
I have code in workbook A in a macro.
I have a button in WorkBook A that when pressed runs the below code.
I want to open another workbook, and then run the macro that is in workbookA on the workbook that was just opened.
The workbook "po ang1324-converted.xls" opens fine, then I get error message "400" and the macro does not run.
I believe the code is all correct, but I keep getting this error. If I comment out the line starting with "Application.Run" then I do not get the error message.
Can someone please help??
I have code in workbook A in a macro.
I have a button in WorkBook A that when pressed runs the below code.
I want to open another workbook, and then run the macro that is in workbookA on the workbook that was just opened.
VBA Code:
Sub RunMacro()
Workbooks.Open "C:\Users\spotts\Documents\Excel VBA\po ang1324-converted.xls"
Application.Run "po ang1324-converted.xls!ApplyFormatting"
End Sub
The workbook "po ang1324-converted.xls" opens fine, then I get error message "400" and the macro does not run.
I believe the code is all correct, but I keep getting this error. If I comment out the line starting with "Application.Run" then I do not get the error message.
Can someone please help??