V
vedran
I have a vbscript below that opens a file, runs a macro and saves the file.
Everything works fine except the macro part. I usualy get a message that
macro has not been found. However, the macro exists and runs just fine when I
go into excel and run it manualy. I have tried changing the path to the file
in XLSTART folder and it doesn't help. Also I have lowered security to low
but no difference there. Can anyone offer any suggestions please? Thanks.
Dim objExcel
Dim objWorkBook
Set objExcel = CreateObject("EXCEL.APPLICATION")
Set objWorkBook = objExcel.Workbooks.Open("File 1.xls")
objExcel.DisplayAlerts=False
objExcel.Run "PERSONAL.xls!FORMAT"
objWorkBook.SaveAs "file 2.xls",44
objExcel.DisplayAlerts=True
objWorkBook.Close True
objExcel.Quit
Set objWorkBook = Nothing
Set objExcel = Nothing
Everything works fine except the macro part. I usualy get a message that
macro has not been found. However, the macro exists and runs just fine when I
go into excel and run it manualy. I have tried changing the path to the file
in XLSTART folder and it doesn't help. Also I have lowered security to low
but no difference there. Can anyone offer any suggestions please? Thanks.
Dim objExcel
Dim objWorkBook
Set objExcel = CreateObject("EXCEL.APPLICATION")
Set objWorkBook = objExcel.Workbooks.Open("File 1.xls")
objExcel.DisplayAlerts=False
objExcel.Run "PERSONAL.xls!FORMAT"
objWorkBook.SaveAs "file 2.xls",44
objExcel.DisplayAlerts=True
objWorkBook.Close True
objExcel.Quit
Set objWorkBook = Nothing
Set objExcel = Nothing