2 timed events? What am I doing wrong or is it not possible?

Mick Peters

Board Regular
Joined
May 18, 2015
Messages
93
I am able to use VBA but no expert most of the code I use is code I have put together from extracts of others to overcome a particular problem, kind of like lego coding :LOL:. I currently have a spread sheet that has a message that displays for 5 seconds if an incorrect entry is made on a user form. That worked until I decided to make a weekly save and clear to reset the work sheet each week without intervention. As the work sheet is open all the time so the timer is running all the time.Now the message timed event no longer seems to work.
I have looked through the codes and cannot see why one would stop another unless you are only allowed 1 timed event to run at a time.
The Code to show the message is below and is attached to a user fork text box after update.
Code:
Case Else 'Message if the user scannes something other than in , out or new.
            'MsgBox "Please enter either IN or OUT"
                Dim AckTime As Integer, InfoBox As Object
    Set InfoBox = CreateObject("WScript.Shell")
    'Set the message box to close after 5 seconds
    AckTime = 5
    Select Case InfoBox.Popup("Please enter either IN or OUT. Please try again.                                                         (This window will close automatically                                                                  after 5 seconds).", _
    AckTime, "Inccorect Destination Scanned", 0)
        Case 1, -1

And the code to save and clear part of the spread sheet is attached to the work book on an open event
Code:
Private Sub Workbook_Open()
        If Weekday(Now()) = 4 Then
        Application.OnTime TimeValue("20:10:00"), "Clear_All"
    End If
    Application.OnTime TimeValue("06:05:00"), "Save"
    Application.OnTime TimeValue("18:05:00"), "Save"
    Application.WindowState = xlMinimized
   Ureg.Show
   Ureg.txtName.SetFocus
    'Ureg.Show modeless
End Sub

Any help or advise would be appreciated.
Thank you in advance.
 
Last edited:

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,214,932
Messages
6,122,331
Members
449,077
Latest member
jmsotelo

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