I have a spreadsheet that has some VBA code that I want to execute once a day every day. Under Windows, I can configure up a scheduled task that correctly launches the spreadsheet, queries PI saves the results then exits. If I try to set this up to run when I am not logged in the scheduled task does not run correctly.
I am using a VBS script to launch excel with a specific workbook
strPath = "C:\Users\Public\Documents\Monticello PM2 Winder\Winder V20-MON-PM2.xlsm"
strMacro = "ReadData"
Set objApp = CreateObject("Excel.Application")
objApp.Visible = False
Set wbToRun = objApp.Workbooks.Open(strPath)
objApp.Run strMacro ' wbToRun.Name & "!" & strMacro
If I run under my credentials when I am logged on, it works. When I use the service account I get in the event viewer. Any though on what I need to do to get this to run?
A Kerberos error message was received:
on logon session GPNET\winder_report
Server Time: 19:24:1.0000 2/21/2020 Z
Error Code: 0x19 KDC_ERR_PREAUTH_REQUIRED
Server Realm: GPNET
Server Name: krbtgt/GPNET
Target Name: krbtgt/GPNET@GPNET
Error Data is in record data.