Kemidan2014
Board Regular
- Joined
- Apr 4, 2022
- Messages
- 229
- Office Version
- 365
- Platform
- Windows
I want a pop up box to automatically close or dismiss after 10 seconds of inactivity. Good has lead me to this code but when i run it the message box does not go away on its own. what could i be missing?
This bit of code is in the middle of other code. Original source i got from the interwebs used "Exit Sub" where all my reprotections and other application settings are now because if i exited on click it left my sheet wide open for all sorts of user input destruction =D
Also i tried simply replacing AckTime with number 10 as the normal syntax just requires a number and that did not work
VBA Code:
Dim AckTime As Integer
Dim box As Object
Set box = CreateObject("WScript.Shell")
AckTime = 10
Select Case box.Popup("Update Complete", AckTime, "Status", 0)
Case 1, -1
Sheets("Complaints").Protect Password:="Secret"
Sheets("AACT").Protect Password:="Secret"
Application.ScreenUpdating = True
Application.DisplayAlerts = True
ThisWorkbook.Save
End Select
This bit of code is in the middle of other code. Original source i got from the interwebs used "Exit Sub" where all my reprotections and other application settings are now because if i exited on click it left my sheet wide open for all sorts of user input destruction =D
Also i tried simply replacing AckTime with number 10 as the normal syntax just requires a number and that did not work