Run an excel macro using a .bat file

haywaro

New Member
Joined
Nov 27, 2005
Messages
1
I can use a .bat file to run a word macro. I simply have the following line of code
"c:\programfiles\microsoftoffice\office\winword.exe"/m(macro name)

Note I do not include the brackets around the name.

I have tried everything and cannot get the same to work in excel.

In need the code to

1. Open excel
2. Open a spreadsheet
3. Run a macro which is saved in personal workbooks on the open spreadsheet.
4. Close excel.

Anyones help would be greatly appreciated!!!!!! I am stumped.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
If Excel is regesterd on the PC then just run the file name from the bat file, it is the same as clicking on the file name in Windows Explorer. In the file you open us an Open Event from ThisWorkbook to run what you need when the Workbook is opened.


c:\temp\blabla.xls
 
Upvote 0

Forum statistics

Threads
1,224,396
Messages
6,178,396
Members
452,844
Latest member
Shebl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top