Good afternoon,
I've had a timed message box that we have been using for years in some of our excel files and all of a sudden the timer functionality has stopped working. The yes, no buttons are fine but the timer is not.
Any ideas on why this would stop working and how to fix?
Thank you
I've had a timed message box that we have been using for years in some of our excel files and all of a sudden the timer functionality has stopped working. The yes, no buttons are fine but the timer is not.
Any ideas on why this would stop working and how to fix?
Thank you
Code:
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Private Const TM_TEXT As String = "The workbook is about to start a macro to pull " & vbCrLf & _
"transaction detail." & vbCrLf & vbCrLf & _
"If you would like the macro to continue click Yes, else click No." & vbCrLf & vbCrLf & _
"If you do nothing the macro will start automatically in a few seconds."
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Private Const TM_TITLE As String = "Data Pull"
Private Const TM_DURATION As Integer = 4 'seconds
Private Sub Workbook_Open()
'-------------------------------------------------------------
'Sub TimedMsgbox()
'-------------------------------------------------------------
Dim WSH As Object
Set WSH = CreateObject("WScript.Shell")
Select Case WSH.Popup(TM_TEXT, TM_DURATION, TM_TITLE, vbYesNo)
Case vbYes
Application.Run "DataPullWorksheet.xlsm!PullData"
Case vbNo
MsgBox "You cancelled the macro!" & vbCrLf & vbCrLf & _
"If you cancelled the macro on accident please click OK below then press CTRL+SHIFT+R to restart the macro."
Case -1
Application.Run "DataPullWorksheet.xlsm!PullData"
Case Else
End Select
End Sub