I am trying to find a macro to open Excel and run a macro. I have tried the following script and while Excel does open and the macro starts it does not complete. Of course the macro has been tested and runs when executed "normally".
{code]
Set xlObj = CreateObject("Excel.application")
xlobj.Visible = True ' Remove comment mark " ' " to see spreadsheets open
xlObj.Workbooks.Open "Z:\My Virtual Machines data\office\current EOD data\QP EOD data\daily stock price -0bar.xls"
xlObj.Run "macro1"
xlObj.ActiveWorkbook.Saved = False xlObj.ActiveWindow.Close
xlObj.Quit
[end code]
I will be happy to provide any additional info if required.
{code]
Set xlObj = CreateObject("Excel.application")
xlobj.Visible = True ' Remove comment mark " ' " to see spreadsheets open
xlObj.Workbooks.Open "Z:\My Virtual Machines data\office\current EOD data\QP EOD data\daily stock price -0bar.xls"
xlObj.Run "macro1"
xlObj.ActiveWorkbook.Saved = False xlObj.ActiveWindow.Close
xlObj.Quit
[end code]
I will be happy to provide any additional info if required.