How do I use Application.OnTime to open a userform in Outlook?
How do I use Application.OnTime to open a userform in Outlook?
Simple way is to call the macro that opens the form using a macro like this:
Private Sub Workbook_Open()
'Runs a macro at 4:30 PM
Application.OnTime TimeValue("16:30:00"), "Name_of_Macro"
End Sub
This macro goes into the ThisWorkbook module and runs when the workbook opens but you can just as easily put it into a regular module and call it from there.
The above macro is from our macro here.
The internet says that OnTime won't work in Outlook:
"To simulate the OnTime Method, create a task with a reminder for the time you want the macro to run. Use a unique Subject string for the task. Hook the BeforeReminderShow Event and check for the unique string in the Subject that you specified when you created the task. If it's a match, run the macro you wanted to run at that time. Also, set Cancel = True so the reminder doesn't actually fire (it already did it's job so it doesn't need to actually fire)."