Option Base 1
Public wb0 As Workbook
Public xlFile0 As String
Public FileName0 As String
xlFile0 = "http:// ..." 'Actual SharePoint URL
FileName0 = wb0.Name
Sub CheckoutFile(FileName As String)
' Determine if workbook can be checked out
If Application.Workbooks.CanCheckOut(xlFile0) Then
Set wb0 = Application.Workbooks.Open(xlFile0)
MsgBox wb0.Name & " is checked out to you."
MsgBox "You are unable to checkout the at this time."
Sub CheckinFile(FileName As String)
' Determine if workbook can be checked in
If Application.Workbooks(FileName).CanCheckIn = True Then
Application.Workbooks(FileName).CheckIn SaveChanges:=True, Comments:="", MakePublic:=False
MsgBox FileName & " was checked in."
MsgBox "You are unable to checkin the " & FileName & " spreadsheet at this time."
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)