Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to stop a msgbox pop up from another workbook
I have a workbook that opens another workbook to grab some values from a
cell. Once the active workbook grabs the data it needs it closes the other workbook. The problem I have is the other workbook has some before close code that prompts a user for an answer in messagebox form. When I run my code from the activeworkbook I don't want this messagebox to show up. Is there a way to make this happen. I tried the DiplayAlerts=False but that did not work. Thanks for your help. Steve |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to stop a msgbox pop up from another workbook
Hi Steve,
One way, in a normal module of the workbook that has the before close message, set a global boolean, which if true flags the event code to not to show the message. The flag would be set by a one line routine called by the application.run method in the other wb. Another way, temporarily disable EnableEvents If neither the above are viable, just before you are about to close you could try Sendkeys Application.SendKeys ("{esc}") wb.Close False Regards, Peter T "Steve O" wrote in message ... I have a workbook that opens another workbook to grab some values from a cell. Once the active workbook grabs the data it needs it closes the other workbook. The problem I have is the other workbook has some before close code that prompts a user for an answer in messagebox form. When I run my code from the activeworkbook I don't want this messagebox to show up. Is there a way to make this happen. I tried the DiplayAlerts=False but that did not work. Thanks for your help. Steve |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to stop a msgbox pop up from another workbook
Thanks Peter! The EnableEvents method worked.
"Peter T" wrote: Hi Steve, One way, in a normal module of the workbook that has the before close message, set a global boolean, which if true flags the event code to not to show the message. The flag would be set by a one line routine called by the application.run method in the other wb. Another way, temporarily disable EnableEvents If neither the above are viable, just before you are about to close you could try Sendkeys Application.SendKeys ("{esc}") wb.Close False Regards, Peter T "Steve O" wrote in message ... I have a workbook that opens another workbook to grab some values from a cell. Once the active workbook grabs the data it needs it closes the other workbook. The problem I have is the other workbook has some before close code that prompts a user for an answer in messagebox form. When I run my code from the activeworkbook I don't want this messagebox to show up. Is there a way to make this happen. I tried the DiplayAlerts=False but that did not work. Thanks for your help. Steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MsgBox to list users in shared workbook | Excel Programming | |||
allow user to change workbook while in Msgbox or InputBox | Excel Programming | |||
Trapping/Answering MsgBox When Workbook Opened From Access? | Excel Programming | |||
How does msgbox stop the OnTime event? | Excel Programming | |||
Msgbox shared workbook | Excel Programming |