Hi,
I need to run VBA code at a random time at night between 9:30pm and 10pm.
Private Sub Workbook_Open()
ActiveWorkbook.RefreshAll
Application.OnTime Now() + TimeValue("00:00:" & CStr(100)), "CDO_Email_Nightly_DSS"
Application.OnTime Now() + TimeValue("00:015:0"), "CDO_Email_Nightly_DSS_Detailed"
'ActiveWorkbook.Close
ActiveWorkbook.Close SaveChanges:=True
End Sub
I need to run VBA code at a random time at night between 9:30pm and 10pm.
Private Sub Workbook_Open()
ActiveWorkbook.RefreshAll
Application.OnTime Now() + TimeValue("00:00:" & CStr(100)), "CDO_Email_Nightly_DSS"
Application.OnTime Now() + TimeValue("00:015:0"), "CDO_Email_Nightly_DSS_Detailed"
'ActiveWorkbook.Close
ActiveWorkbook.Close SaveChanges:=True
End Sub