Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm developing an Office COM Add-in by using Visual C# .NET. The purpose of the add-in is to prevent any open workbook to get closed. To achieve this I've implemented the following handler for the Workbook_BeforeClose event of the Excel.Application object. private void Connect_WorkbookBeforeClose(Excel.Workbook Wb, ref bool Cancel) { System.Windows.Forms.MessageBox.Show("It's not allowed closing the workbook!"); Cancel = true; } At runtime, closing a workbook it pops up the message AND CLOSES the workbook. The even is not canceled. Am I missing anything? Thanks, Mircea |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"this operation has been canceled due to restrictions in effect on | Excel Discussion (Misc queries) | |||
question about Auto_Close and WorkbookBeforeClose | Excel Programming | |||
Run Macro If Save Is Canceled On SaveAs Window In VBA | Excel Programming | |||
Run Macro If Save Is Canceled On SaveAs Window In VBA | Excel Programming | |||
Handling WorkbookBeforeClose and WorkbookBeforeSave | Excel Programming |