View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tim Zych[_4_] Tim Zych[_4_] is offline
external usenet poster
 
Posts: 58
Default Unhook (then rehook) workbook events???

Application.EnableEvents = False
' run whatever you want
Application.EnableEvents = True

since it's application level, not sure if it's what you want. It also
disables more than just the BeforeSave event.


"Tim Williams" <saxifrax at pacbell dot net wrote in message
...

I'm working with an application which automates Excel to host a "Report"
workbook. There are various types of "sessions" during which a user can
interact with the workbook in a more or less limited way (eg. saving of

the
workbook under another name is not permitted).

It seems that in one particular session type the controlling application

has
hooked the Workbook_Beforesave event such that choosing "Save" from the
Excel menu calls a particular piece of code but does not save the

workbook.

Anyone know whether it's possible (without access to the controlling code)
to "unhook" the Beforesave event temporarily so that I can save the
workbook, and then "rehook" the event ?

Thanks for any ideas,
Tim.