I have a VBA Macro that runs via a VBA Script file triggered by Windows Scheduler daily. It, and three other similar daily Macros, run an their own Virtual Machine away from any pesky users. Every two or three months, the scripts stop running and I see a litany of "Signon Manager Screens" Anyone know how to fix this - or are there any best practices for regular scheduled macros that I am missing?:
Script below:
Dim Signon
Dim SignonID
dim strCommand
Set Signon = CreateObject("A4wSignonMgr.AccpacSignonMgr")
'Change the Signon paramters to match the company login
'SignonID = Signon.RegisterSignon("USERID", "PASSWORD", "COMPANYID", "Company Name", Date)
'USERID = Accpac user in upper case
'PASSWORD = Accpac user password in upper case
'COMPANYID = Accpac company ID in upper case
SignonID = Signon.RegisterSignon("*********", "********", "********", "********", Date)
'Change the macro name and path
strCommand = "A4WVBA.EXE -r -f ""C:\FUTURE_PRICE_LIST_MACRO\ItemsFromQuotesToPriceListsOnDate.avb"""
Set wshShell = WScript.CreateObject ("WSCript.shell")
wshshell.run strCommand, 6, True
set wshshell = nothing
Signon.SignoffSession SignonID
Set Signon = Nothing