ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Run Macro from Command line (https://www.excelbanter.com/excel-discussion-misc-queries/151118-run-macro-command-line.html)

Phil Smith

Run Macro from Command line
 
I want to run a macro when I open a particular spreadsheet. I know I
can get a macro to run every single time it opens, but I do not want
that. I want to start Excel externally, (from a shortcut) and either
load it and run the macro, or load it and not run the macro.

I do not see any option to open and run a macro from the command line.

Does it exist? Is there another way to pull this off?

Phil

David McRitchie

Run Macro from Command line
 
You could put data into a text file and read that from
your VBA code. You could use a .bat file to create/modify
the file.

--
HTH,
David McRitchie, Microsoft MVP - Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Phil Smith" wrote in message ...
I want to run a macro when I open a particular spreadsheet. I know I
can get a macro to run every single time it opens, but I do not want
that. I want to start Excel externally, (from a shortcut) and either
load it and run the macro, or load it and not run the macro.

I do not see any option to open and run a macro from the command line.

Does it exist? Is there another way to pull this off?

Phil





All times are GMT +1. The time now is 08:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com