PDA

View Full Version : Solved: Automate msgbox cancel



IrishCharm
06-24-2008, 06:16 AM
hi,

I want to run a control macro whereby i open and run serveral different macros from different locations. the only problem is that there are msgbox's every now and again. these need to remain but when i am running all the macros at once, i do not need them to pop up - is there a way to cancel in VB a msgbox that pops up? i.e. something similar to application.disaplayalerts = false for a msgbox?

Cheers

Sarah

Bob Phillips
06-24-2008, 06:31 AM
Create a userform and when it loada run an Ontime macro that unloads it in say 5 secs.

IrishCharm
06-24-2008, 06:48 AM
Hi, thats a perfect idea thanks. I'm having trouble though with unloading the msgbox once i am finished - any ideas?

Sarah



Sub str_Hello()
MsgBox ("hello world")
End Sub

Sub testing()
Application.OnTime Now + TimeValue("00:00:03"), "str_hello"
Application.OnTime EarliestTime:=TimeValue("00:00:03"), Procedure:="str_hello", Schedule:=False
End Sub

Bob Phillips
06-24-2008, 07:13 AM
No I said a userform, and fire the Ontime from there

IrishCharm
06-24-2008, 07:19 AM
ok. apologies i completely mis read your comments - a userform works a treat.

Cheers for the help, and the sample workbook.

Sarah