View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Steve O Steve O is offline
external usenet poster
 
Posts: 8
Default 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