Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Is it possible to prevent WB_BeforeClose with VBA?
When opening and then closing WB1 from WB2 I don't want the
Workbook_BeforeClose macros to execute in WB1. Holding down the shift will manually do this, but is there a way with VBA? Thank you. Jim Kobzeff |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Is it possible to prevent WB_BeforeClose with VBA?
You can tell excel to stop monitoring events.
application.enableevents = false wb1.close savechanges:=true 'false application.enableevents = true JK wrote: When opening and then closing WB1 from WB2 I don't want the Workbook_BeforeClose macros to execute in WB1. Holding down the shift will manually do this, but is there a way with VBA? Thank you. Jim Kobzeff -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Is it possible to prevent WB_BeforeClose with VBA?
Jim,
Try something like Application.EnableEvents = False WB1.Close Application.EnableEvents = True -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "JK" wrote in message ... When opening and then closing WB1 from WB2 I don't want the Workbook_BeforeClose macros to execute in WB1. Holding down the shift will manually do this, but is there a way with VBA? Thank you. Jim Kobzeff |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
HOW CAN I PREVENT EXCEL FILES FROM BEING DELETED OR PREVENT TRASH | Excel Discussion (Misc queries) | |||
How to prevent marqueue | New Users to Excel | |||
Prevent other from seeing VBA | Excel Discussion (Misc queries) | |||
Prevent PageDown | Excel Programming | |||
prevent duplication | Excel Discussion (Misc queries) |