• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

run macro at opening after time

ok let me explain
i wrote a code to backup files with timestamps and that i do it by a single wb that open run the code and close and i have put it in the start menu so when windows start the file to execute.
until now all good
but i want some delay of running the code or prompt me to stop
i mean when the file open to msg me that the macro will run after 5 sec or if i want to stop
now at the moment i found a middle solution to ask me to run or cancel but i want this if not cancel to show off
 

Attachments

  • BACKUP.xlsm
    15.4 KB · Views: 8
Try something like...
Code:
Sub Demo()
Dim actTime As Integer, infoBox As Object
Set infoBox = CreateObject("WScript.Shell")
actTime = 5
Select Case infoBox.Popup("Click OK to CANCEL, or code will continue after 5 sec", actTime, , 0)
    Case 1
        Exit Sub
    Case -1
        'Do something
End Select
End Sub
 
Back
Top