The macro may not be available in this workbook or all macros may be disabled.

micfly

Well-known Member
Joined
Sep 8, 2008
Messages
543
I have this code placed in the ThisWorkbook:
Code:
Private Sub TimedMacro()
     
     'This should be the macro that runs; we simply show a message box
    MsgBox "Are you finished with the Sales Log? If so, please close it.", vbInformation
     
End Sub
Code:
Private Sub Workbook_Open()
'TimeSerial(hours, minutes, seconds)
    Application.OnTime Now + TimeSerial(0, 1, 0), "TimedMacro"
End Sub


What's worng with this? When the timed period arrives I get "Cannot run the macro "C:\Users\me\Desktop\SalesLog.xls'!TimedMacro'. The macro may not be available in this workbook or all macros may be disabled." instead of it showing the MsgBox??? Macros ARE enabled in the work book.

Or if there is a better way to do this. I just want a nag reminder to pop up every five minutes. Thanks for any help.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Try putting the

Code:
Private Sub TimedMacro()
     
     'This should be the macro that runs; we simply show a message box
    MsgBox "Are you finished with the Sales Log? If so, please close it.", vbInformation
     
End Sub

In its own module.
 
Upvote 0

Forum statistics

Threads
1,215,036
Messages
6,122,794
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top