Workbooks.CanCheckOut Method (Excel)

True if Microsoft Excel can check out a specified workbook from a server. Read/write Boolean .


expression. CanCheckOut( _Filename_ )

expression A variable that represents a Workbooks object.


Name Required/Optional Data Type Description
Filename Required String The name of the file to check out.

Return Value



This example verifies that a workbook is not checked out by another user and can be checked out. If the workbook can be checked out, it copies the workbook to the local computer for editing.

Sub UseCanCheckOut(docCheckOut As String) 
 ' Determine if workbook can be checked out. 
 If Workbooks.CanCheckOut(Filename:=docCheckOut) = True Then 
 Workbooks.CheckOut (Filename:=docCheckOut) 
 MsgBox "You are unable to check out this document at this time." 
 End If 
End Sub

See also

Workbooks Object