次の方法で共有


WorkbookBase.CanCheckIn Method

Definition

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

public:
 bool CanCheckIn();
public bool CanCheckIn ();
member this.CanCheckIn : unit -> bool
Public Function CanCheckIn () As Boolean

Returns

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 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.");
    }
}
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

Applies to