Using Application.Run in Excel VBA when workbook name contains spaces
Here File_name is the name of the file for which you want to call your macro
- Application.run "'"+File_name+"'"+"!Macro"
- Single quote in between double quote followed by + File_name + single quote in between double quote + your macro name in between double quotes.
Use single quotes surrounding the filename:
Application.Run "'My Work Book.xls'!Macro1"
Replace each of the spaces with %20
Application.Run "My%20Work%20Book.xls!Macro1"