satputenandk
09-03-2014, 06:00 AM
Dear Members,
I have below vbs code to open workbook run macro and then close. But I having problem with file saving. It is asking for save the copy of file. I am looking for command in vbs like thisworkbook.save is in excel.
Option Explicit
Dim xlApp, xlBook
Set xlApp = CreateObject("Excel.Application")
'~~> Change Path here
Set xlBook = xlApp.Workbooks.Open("C:\Documents and Settings\tg\Desktop\Nasik.xls", 0, True)
xlApp.Run "TrackingSheet"
xlApp.Save
xlBook.Close
xlApp.Quit
Set xlBook = Nothing
Set xlApp = Nothing
WScript.Echo "Finished."
WScript.Quit
Regards,
Nandkumar S.
I have below vbs code to open workbook run macro and then close. But I having problem with file saving. It is asking for save the copy of file. I am looking for command in vbs like thisworkbook.save is in excel.
Option Explicit
Dim xlApp, xlBook
Set xlApp = CreateObject("Excel.Application")
'~~> Change Path here
Set xlBook = xlApp.Workbooks.Open("C:\Documents and Settings\tg\Desktop\Nasik.xls", 0, True)
xlApp.Run "TrackingSheet"
xlApp.Save
xlBook.Close
xlApp.Quit
Set xlBook = Nothing
Set xlApp = Nothing
WScript.Echo "Finished."
WScript.Quit
Regards,
Nandkumar S.