This documentation is archived and is not being maintained.

Workbook.Open Event

Occurs when the workbook is opened.

Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel (in microsoft.office.tools.excel.dll)

public event WorkbookEvents_OpenEventHandler Open

The following code example demonstrates a handler for the Open event. The event handler maximizes the Microsoft Office Excel application window when the current workbook is opened.

private void WorkbookOpen()
{
    this.Open +=
        new Excel.WorkbookEvents_OpenEventHandler(
        ThisWorkbook_Open);
}

void ThisWorkbook_Open()
{
    this.Application.WindowState = Excel.XlWindowState.xlMaximized;
}

Show: