Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Excel Macro from Command Line
Is there a way to run an Excel macro from a command line. Such as when you
open up a file to have it run the macro. Since I want to do this for files that are newly created I can not program the file to run the macro at startup. Is there a command line option in excel? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Excel Macro from Command Line
Can you use automation to run the macro? You can create a script file
to do this and run it from the command line.... Others may have more suggestions if you can outline what it is you're doing. Tim. "Al Franz" wrote in message ... Is there a way to run an Excel macro from a command line. Such as when you open up a file to have it run the macro. Since I want to do this for files that are newly created I can not program the file to run the macro at startup. Is there a command line option in excel? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Excel Macro from Command Line
On Sun, 12 Jun 2005 21:25:08 -0700, "Al Franz"
wrote in microsoft.public.excel.programming: Is there a way to run an Excel macro from a command line. Such as when you open up a file to have it run the macro. Since I want to do this for files that are newly created I can not program the file to run the macro at startup. Is there a command line option in excel? Not to my knowledge. You have to write some VBS code for that. E.g.: Option Explicit Dim objXL Set objXL = WScript.CreateObject("Excel.Application") objXL.WorkBooks.Open "d:\dir\fubar.xls" objXL.Visible = TRUE ' Optional objXL.Run("yourMacro") objXL.Quit Set objXL = Nothing -- Michael Bednarek http://mbednarek.com/ "POST NO BILLS" |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run Excel Macro from Command Line
There is no command line option in excel that will allow you to do this but
you shouldn't need to. How are you creating the new workbooks? I assume you will do it programmatically from another workbook that you're working from? If so then you can do whatever you need to do to this newly created file from that workbook; even have it write the module to your new file. Would probably need some more information on what you are trying to do so if you can explain in more detail then I may have some example code to help you. "Al Franz" wrote: Is there a way to run an Excel macro from a command line. Such as when you open up a file to have it run the macro. Since I want to do this for files that are newly created I can not program the file to run the macro at startup. Is there a command line option in excel? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run Macro from Command line | Excel Discussion (Misc queries) | |||
Running a macro from a command line | Excel Programming | |||
Running a macro from the command line | Excel Programming | |||
call excel 2003 macro from command line | Excel Programming | |||
Excel macro on a DOS command line | Excel Programming |