Share via


Workbook.CanCheckIn Method

Excel Developer Reference

True if Microsoft Excel can check in a specified workbook to a server. Read/write Boolean.

Syntax

expression.CanCheckIn

expression   A variable that represents a Workbook object.

Return Value
Boolean

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.

Visual Basic for Applications
  Sub CheckInOut(strWkbCheckIn As String)
' Determine if workbook can be checked in.
If Workbooks(strWkbCheckIn).<strong>CanCheckIn</strong> = True Then
    Workbooks(strWkbCheckIn).CheckIn
    MsgBox strWkbCheckIn &amp; " has been checked in."
Else
    MsgBox "This file cannot be checked in " &amp; _
        "at this time.  Please try again later."
End If

End Sub

See Also