Option Base 1 Public wb0 As Workbook Public xlFile0 As String Public FileName0 As String Sub Automation_Vetting_Process() xlFile0 = "http:// ..." 'Actual SharePoint URL CheckoutFile (xlFile0) FileName0 = wb0.Name CheckinFile (FileName0) End Sub Sub CheckoutFile(FileName As String) ' Determine if workbook can be checked out If Application.Workbooks.CanCheckOut(xlFile0) Then Application.Workbooks.CheckOut xlFile0 Set wb0 = Application.Workbooks.Open(xlFile0) MsgBox wb0.Name & " is checked out to you." Else MsgBox "You are unable to checkout the at this time." End If End Sub 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." Else MsgBox "You are unable to checkin the " & FileName & " spreadsheet at this time." End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)