Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Is there a switch that will run a macro in my personal workbook from a
command line? |
#2
![]() |
|||
|
|||
![]()
Cyberwolf wrote:
Is there a switch that will run a macro in my personal workbook from a command line? ------------------------ I don't quite understand what you mean by command line within the Excel context? What you can do if you wish, is to create a button for it. Push the button and the macro executes. You can place the button either on a sheet, or up in your tool bar. Bill |
#3
![]() |
|||
|
|||
![]()
Cyberwolf wrote:
Is there a switch that will run a macro in my personal workbook from a command line? ------------------------ I don't quite understand what you mean by command line within the Excel context? You know you can assign a key chord to invoke a macro? Ctrl-a, Ctrl-b, etc. What you can do if you wish, is to create a button for it. Push the button and the macro executes. You can place the button either on a sheet, or up in your tool bar. Bill |
#4
![]() |
|||
|
|||
![]() "Bill Martin -- (Remove NOSPAM from address)" wrote in message ... Cyberwolf wrote: Is there a switch that will run a macro in my personal workbook from a command line? ------------------------ I don't quite understand what you mean by command line within the Excel context? You know you can assign a key chord to invoke a macro? Ctrl-a, Ctrl-b, etc. What you can do if you wish, is to create a button for it. Push the button and the macro executes. You can place the button either on a sheet, or up in your tool bar. Bill The *simple* answer is no because Excel lacks Word's /m command line switch .... however Michael Bednarek of the microsoft.public.excel.programming forum helped develope the following WSH/VBS work-around. Save excel.vbs somewhere along your command Path (ie:c:\windows\command\e.vbs) then either setup shortcut icons to indivual macros or invoke it directly via the Windows Run box. ie: [Windows]+R excel.vbs macroname [enter] ' Filename: excel.vbs ' Overcomes Excel inability to run macros from the command line ' Usage: excel.vbs modulename.macroname ' modulename not required if macroname in default Module1 ' requires WSH to be installed ' 'open excel Dim macro Dim XLApp Dim XLWkb Set XLApp = CreateObject("Excel.Application") xlapp.visible = true xlapp.workbooks.add xlapp.workbooks.open "C:\Program Files\Microsoft Office\Office\Xlstart\personal.xls" ' 'now run macro If wscript.arguments.count = 0 Then 'do nothing Else macro = "Personal.xls!" & WScript.Arguments.item(0) xlapp.run macro End If |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Enabling macros | Excel Discussion (Misc queries) | |||
sorting with macros | Excel Discussion (Misc queries) | |||
Transferring toolbars and macros to other computers | Excel Discussion (Misc queries) | |||
The available macros list in XL; how to suppress filename from showing | Excel Discussion (Misc queries) | |||
Macros disappear after a file is imported | Excel Discussion (Misc queries) |