Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook_BeforeClose event is not canceled
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Workbook_BeforeClose event is not canceled
Hi
This is an known issue, and it has been fixed in office 2003, I have verified it on my side. Here is a link for your reference. BUG: Cancel parameter for Office events is ignored in Visual Studio .NET 2003 (830519) http://support.microsoft.com/default...B;EN-US;830519 Best regards, Peter Huang Microsoft Online Partner Support Get Secure! - www.microsoft.com/security This posting is provided "AS IS" with no warranties, and confers no rights. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
WorkbookBeforeClose event is not canceled | Excel Programming | |||
Detecting a cancel on Workbook_BeforeClose event? | Excel Programming | |||
Run Macro If Save Is Canceled On SaveAs Window In VBA | Excel Programming | |||
Workbook_Beforeclose vs BeforeClose Event | Excel Programming | |||
Workbook_BeforeClose Event | Excel Programming |