Freigeben über


WorkbookBase.AddinUninstall Event

Definition

Occurs when the workbook is uninstalled as an add-in.

public:
 event Microsoft::Office::Interop::Excel::WorkbookEvents_AddinUninstallEventHandler ^ AddinUninstall;
public event Microsoft.Office.Interop.Excel.WorkbookEvents_AddinUninstallEventHandler AddinUninstall;
member this.AddinUninstall : Microsoft.Office.Interop.Excel.WorkbookEvents_AddinUninstallEventHandler 
Public Custom Event AddinUninstall As WorkbookEvents_AddinUninstallEventHandler 

Event Type

Examples

The following code example demonstrates a handler for the AddinUninstall event. The event handler minimizes Microsoft Office Excel when the workbook is uninstalled as an add-in.

This example is for a document-level customization.

private void WorkbookAddinUninstall()
{
    this.AddinUninstall +=
        new Excel.WorkbookEvents_AddinUninstallEventHandler(
        ThisWorkbook_AddinUninstall);
}

void ThisWorkbook_AddinUninstall()
{
    this.Application.WindowState = Excel.XlWindowState.xlMinimized;
}
Sub ThisWorkbook_AddinUninstall() Handles Me.AddinUninstall
    Me.Application.WindowState = Excel.XlWindowState.xlMinimized
End Sub

Remarks

The add-in does not automatically close when it is uninstalled.

Applies to