Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MsgBox to list users in shared workbook systemx[_6_] Excel Programming 1 March 9th 06 03:05 PM
allow user to change workbook while in Msgbox or InputBox [email protected] Excel Programming 1 March 22nd 05 02:33 AM
Trapping/Answering MsgBox When Workbook Opened From Access? LarryP[_2_] Excel Programming 9 May 28th 04 11:36 PM
How does msgbox stop the OnTime event? Emile van Mierlo Excel Programming 12 May 4th 04 01:10 PM
Msgbox shared workbook Flemming Dahl Excel Programming 2 October 2nd 03 08:20 PM


All times are GMT +1. The time now is 02:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"