This documentation is archived and is not being maintained.

Workbook.CanCheckIn Method

Gets a value that indicates whether Microsoft Office Excel can check in the workbook to a server.

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

public virtual bool CanCheckIn ()

Return Value

true if Microsoft Office Excel can check in the workbook to a server; otherwise, false.

The following code example uses the CanCheckIn method to determine whether Microsoft Office Excel can check in the current workbook to a server. If the workbook can be checked in, then the example uses the CheckIn method to save revisions and check in the current workbook.

private void WorkbookCheckIn()
{
    // Determine if workbook can be checked in.
    if (this.CanCheckIn())
    {
        this.CheckIn(true, "Updates.", true);
        MessageBox.Show(this.Name + " was checked in.");
    }
    else
    {
        MessageBox.Show(this.Name + " cannot be checked in.");
    }
}

Show: