We have several Excel VBA applications that run over night
automatically. You need 3 things to make this happen. First, you have
to include a subroutine in "This Workbook," similar to the code shown below:
Private Sub Workbook_Open()
Application.Wait (Now + TimeValue("0:00:05"))
ClearOld
StageForecasts
AHAPSMailSub
Application.Wait (Now + TimeValue("0:0:30"))
ThisWorkbook.Save
Application.Quit
End Sub
This code calls 3 other subroutines plus saves and quits the
application. There are also some pauses to allow editing.
Second, the application has to be digitally signed, so it can run upon
opening without any input.
Third, schedule the application to run using the Scheduled Tasks utility
in Windows.
We've been running these for a few months and it works pretty well.