CheckIn Method

Microsoft Excel Visual Basic

CheckIn Method

       

Performs a check-in (with or without publish) or undo-check-out of the working copy on the server. Read/write.

expression.CheckIn(SaveChanges, Comments, MakePublic)

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

SaveChanges  Optional Variant. True saves changes and checks in the document. False returns the document to a checked-in status without saving a new revision.

Comments  Optional Variant. Allows the user to enter check-in comments for the revision of the document being checked in (only applies if SaveChanges equals True).

MakePublic  Optional Variant. Allows the user to perform a publish on the document after being checked in. This submits the document for the approval process, which can eventually result in a version of the document being published to users with read-only rights to the workspace (only applies if SaveChanges equals True).

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