ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Run Excel macro from Win 10 Run box? (https://www.excelbanter.com/excel-discussion-misc-queries/454551-run-excel-macro-win-10-run-box.html)

Terry Pinnell[_4_]

Run Excel macro from Win 10 Run box?
 
I can open an Excel workbook from the Run box with
C:\Users\terry\Walks\WalkIndex.xlsm

But how do I add parameters so that it will then run a specific macro
please?

Terry, East Grinstead, UK


GS[_6_]

Run Excel macro from Win 10 Run box?
 
I can open an Excel workbook from the Run box with
C:\Users\terry\Walks\WalkIndex.xlsm

But how do I add parameters so that it will then run a specific macro
please?

Terry, East Grinstead, UK


Use that workbook's Workbook_Open event to Call the macro, OR use an Auto_Open
Sub (better) in a standard module to setup what should happen when the file
opens.

Note that Auto_Open() is the *replacement* for the Workbook_Open event, and
should be companioned with an Auto_Close() Sub which is the *replacement* for
the Workbook_BeforeClose event.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion

GS[_6_]

Run Excel macro from Win 10 Run box?
 
If you have several macros and wish to specify which to run, you could have a
popup list to choose from.

OR

If you want individual executables from say a desktop folder, instead of using
Excel macros just run a vbScript file (e.g.: Macro1.vbs) to do same as your
macro would do.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


All times are GMT +1. The time now is 06:36 AM.

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