VBA for Excel , message pop up at a time specified

Alex Keraut 6 Reputation points
2021-11-24T14:06:27.02+00:00

Hi,

Users are working with macros-enables Excel workbook.

Is there an opportunity to generate a VBA message at a specified time?
Example : Excel message pops up at 10pm CET and says "Please stop working and go home".

Thanks

Microsoft 365 and Office Development Other
Developer technologies Visual Basic for Applications
Developer technologies VB
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Viorel 122.5K Reputation points
    2021-11-24T15:18:53.987+00:00

    Try executing a code like this:

    Application.OnTime "22:00", "MyProcedure"
    

    Also add a module containing this procedure:

    Public Sub MyProcedure()
    
        MsgBox "Please stop working and go home"
    
    End Sub
    

    Probably the OnTime function can be called automatically from the Open event of workbook.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.