View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] ngraved@gmail.com is offline
external usenet poster
 
Posts: 2
Default Command line used for opening .xls files and clicking abutton/running a function.

Ok, I finally found something I can work with:

Option Explicit

On Error Resume Next

ExcelMacroExample

Sub ExcelMacroExample()

Dim xlApp
Dim xlBook

Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open("C:\MyWorkbook.xls", 0, True)
xlApp.Run "MyMacro"
xlApp.Quit

Set xlBook = Nothing
Set xlApp = Nothing

End Sub

..vbs script which can be used.