Running a macro from the command line

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do you use the command line to run a specific macro on a specific xls
file?

In Word, I use this syntax:

winword FileName /mMacroName

But doing this in Excel opens Excel but does not run the macro:

excel FileName /mMacroName
 
Excel does not support naming a macro to run from the command line. The
only macro that runs automatically with a workbook opening is its
WorkBook_Open event handler and a sub named Auto_Open if one exists. If
these routines could find the name of the macro you wanted run they could
run it. Maybe in an INI file or in the registry? I've never had to do
this.

--
Jim Rech
Excel MVP
| How do you use the command line to run a specific macro on a specific xls
| file?
|
| In Word, I use this syntax:
|
| winword FileName /mMacroName
|
| But doing this in Excel opens Excel but does not run the macro:
|
| excel FileName /mMacroName
|
| --
| Karel
 
Back
Top