CanCheckIn Method

Microsoft Excel Visual Basic

expression.CanCheckIn

expression    Required. An expression that returns one of the objects in the Applies To list.

Example

This example checks the server to see if the specified workbook can be checked in. If it can be, it saves and closes the workbook and checks it back into the server.

Sub CheckInOut(strWkbCheckIn As String)

    ' Determine if workbook can be checked in.
    If Workbooks(strWkbCheckIn).CanCheckIn = True Then
        Workbooks(strWkbCheckIn).CheckIn
        MsgBox strWkbCheckIn & " has been checked in."
    Else
        MsgBox "This file cannot be checked in " & _
            "at this time.  Please try again later."
    End If

End Sub