Name
workbooks.CanCheckOut(Filename)
Synopsis
For workbooks that are part of a shared workspace, verifies that the workbook is available to be checked out. Use CanCheckOut to verify that the file is available before calling the CheckOut method.
|
Argument |
Settings |
|---|---|
|
|
The address of the file on the SharePoint server for which to verify the status |
Returns True if the current user can check out a shared workbook from the SharePoint server. Returns False if the workbook cannot be checked out. Causes an error if the SharePoint server or file can’t be found.
The following code checks out a file from a SharePoint server, first verifying that it is available:
fil = "//wombat2/Team Wombat/Shared Documents/ch08.xls"
If Application.Workbooks.CanCheckOut(fil) Then
Application.Workbooks.CheckOut (fil)
Set wb = Application.Workbooks.Open(fil)
If wb.SharedWorkspace.Connected Then _
msg = "ch08.xls is check out to you."
Else
msg = "ch08.xls could not be checked out."
End If
MsgBox msgBecome an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access