rcolving
Board Regular
- Joined
- May 23, 2002
- Messages
- 124
- Office Version
- 365
- 2021
- 2019
- 2016
- 2013
- Platform
- Windows
I have a customer that has an Excel Workbook that they never close. His people do not click save. So if the PC happens to update and reboot they lose all data input. I am trying to create a VBS script that I can schedule with task manager to save the workbook at days end. I have this script but get errors: Line 6, Object required: 'objExcel.ActiveWorkbook' Code: 800A01A8. Can anyone help with this?
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks
objExcel.Application.Visible = True
objExcel.ActiveWorkbook.Save ("C:\user\randy\documents\VBS Save Test.xlsx")
objExcel.Application.Quit
WScript.Quit
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks
objExcel.Application.Visible = True
objExcel.ActiveWorkbook.Save ("C:\user\randy\documents\VBS Save Test.xlsx")
objExcel.Application.Quit
WScript.Quit