Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Running a macro from the command line

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Running a macro from the command line

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
"Czech" wrote in message
...
| 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run Macro from Command line Phil Smith Excel Discussion (Misc queries) 1 July 21st 07 06:35 PM
Running a Command Button from a different sheet Lester Lee Excel Programming 5 July 14th 04 05:15 PM
call excel 2003 macro from command line Keven[_2_] Excel Programming 1 June 2nd 04 05:33 AM
Command line parameters into a macro Donemowe Excel Programming 3 August 6th 03 09:12 AM
Excel macro on a DOS command line Richard[_13_] Excel Programming 3 July 18th 03 03:35 AM


All times are GMT +1. The time now is 03:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"