Share via


Workbook.CanCheckIn Method (2007 System)

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.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Syntax

'Declaration
Public Function CanCheckIn As Boolean
'Usage
Dim instance As Workbook 
Dim returnValue As Boolean 

returnValue = instance.CanCheckIn()
public bool CanCheckIn()
public:
bool CanCheckIn()
public function CanCheckIn() : boolean

Return Value

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

Examples

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.

This example is for a document-level customization.

Private Sub WorkbookCheckIn()
    ' Determine if workbook can be checked in. 
    If Me.CanCheckIn() Then 
        Me.CheckIn(True, "Updates.", True)
        MsgBox(Me.Name & " was checked in.")
    Else
        MsgBox(Me.Name & " cannot be checked in.")
    End If 
End Sub
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.");
    }
}

.NET Framework Security

See Also

Reference

Workbook Class

Workbook Members

Microsoft.Office.Tools.Excel Namespace