I can not close a workbook because it collects data 24hrs. i am using VBS to send this workbook using a macro that was saving the file first then send the email with this workbook attached. i used Task scheduler to trigger this vbs file. it worked for 3 weeks but now i get an unknown error.
vbs file:
Option Explicit
Dim xlBook, xlApp
Set xlBook = GetObject("C:\Users\folder1\Desktop\Test\workbook1.xlsm")
Set xlApp = xlBook.Application
xlApp.run "MY_SendEmail_Example1" ' macro in workbook
'xlApp.save
xlApp.Quit
Set xlBook = Nothing
Set xlApp = Nothing
vbs file:
Option Explicit
Dim xlBook, xlApp
Set xlBook = GetObject("C:\Users\folder1\Desktop\Test\workbook1.xlsm")
Set xlApp = xlBook.Application
xlApp.run "MY_SendEmail_Example1" ' macro in workbook
'xlApp.save
xlApp.Quit
Set xlBook = Nothing
Set xlApp = Nothing