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

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,564 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,459 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Viorel 111.8K 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