PDA

View Full Version : VBA Sharepoint Check out & Check in - Please help a newbie!!



Superstig666
11-27-2014, 03:19 AM
Hi Folks
I have a problem! After being pointed in the direction of the Microsoft pages for assistance with Check out & Check in documents via VBA.
After some investigating and general searching I have managed to nearly get what I need but need asistance with the following

Please could someone advise how to change the following (or provide an alternative) to apply to a number of other excel files on Sharepoint at the same time? i.e check out the file mentioned plus a number of others. Ideally something that would checkout all files in a sharepoint folder for example or a code to check out all open workbooks if I opened them first

Sub test()
Dim docCheckOut As String
docCheckOut = "//teamspace.intranet.group/site...I/Forcast Team.xls"
Call UseCheckOut(docCheckOut)
End Sub
Sub UseCheckOut(docCheckOut As String)
' Determine if workbook can be checked out.
If Workbooks.CanCheckOut(docCheckOut) = True Then
Workbooks.CheckOut docCheckOut
Else
MsgBox "Unable to check out this document at this time."
End If
End Sub

Many thanks as always! Jamie