Partilhar via


WorkbookBase.CheckIn Method

Returns a workbook from a local computer to a server, and sets the local workbook to read-only so that it cannot be edited locally. Calling this method closes the workbook.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

Syntax

'Declaration
Public Sub CheckIn ( _
    saveChanges As Object, _
    comments As Object, _
    makePublic As Object _
)
public void CheckIn(
    Object saveChanges,
    Object comments,
    Object makePublic
)

Parameters

  • saveChanges
    Type: System.Object

    true saves changes and checks in the document; false returns the document to a checked-in status without saving revisions.

  • comments
    Type: System.Object

    Allows the user to enter check-in comments for the revision of the workbook being checked in (applies only if SaveChanges equals true).

  • makePublic
    Type: System.Object

    true allows the user to publish the workbook after it has been checked in. This submits the workbook for the approval process, which can eventually result in a version of the workbook being published to users with read-only rights to the workbook (applies only if SaveChanges equals true).

Remarks

Optional Parameters

For information on optional parameters, see Optional Parameters in Office Solutions.

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

WorkbookBase Class

Microsoft.Office.Tools.Excel Namespace