V
vedran
Hi,
I have a simple script that should open a workbook, run a macro and save the
file. Everything except the macro part works fine. The file opens and saves
but macro does not run. Can someone please advise me what am I doing wrong.
Below is the script.
Thanks
Dim objExcel
Dim objWorkBook
Set objExcel = CreateObject("EXCEL.APPLICATION")
Set objWorkBook = objExcel.Workbooks.Open("C:\File1.xls")
objExcel.DisplayAlerts=False
objExcel.Run "PERSONAL.xls!FORMAT"
objWorkBook.SaveAs "C:\file2.xls",44
objExcel.DisplayAlerts=True
objWorkBook.Close True
objExcel.Quit
Set objWorkBook = Nothing
Set objExcel = Nothing
I have a simple script that should open a workbook, run a macro and save the
file. Everything except the macro part works fine. The file opens and saves
but macro does not run. Can someone please advise me what am I doing wrong.
Below is the script.
Thanks
Dim objExcel
Dim objWorkBook
Set objExcel = CreateObject("EXCEL.APPLICATION")
Set objWorkBook = objExcel.Workbooks.Open("C:\File1.xls")
objExcel.DisplayAlerts=False
objExcel.Run "PERSONAL.xls!FORMAT"
objWorkBook.SaveAs "C:\file2.xls",44
objExcel.DisplayAlerts=True
objWorkBook.Close True
objExcel.Quit
Set objWorkBook = Nothing
Set objExcel = Nothing