Quantcast
Viewing all articles
Browse latest Browse all 2

Answer by Gaff for Excel 2003: open spreadsheet and run macro from command line

You could do this with VBScript. Here's some example code:

Option ExplicitDim excelObjectSet excelObject = CreateObject("Excel.Application")excelObject.WorkBooks.Open "path:\to\file.xls", 0, TrueexcelObject.Run "MacroName"excelObject.QuitSet excelObject = Nothing

Paste that into a file with extension .vbs and running that script should open the desired spreadsheet in Excel, running the macro with name 'MacroName'.


Viewing all articles
Browse latest Browse all 2

Trending Articles