+ Reply to Thread
Results 1 to 2 of 2

Workbook_BeforeClose event is not canceled

  1. #1
    Mircea Pleteriu
    Guest

    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. #2
    Peter Huang [MSFT]
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1