walexnelson2
New Member
- Joined
- Sep 4, 2013
- Messages
- 2
I have a local macro that pulls down workbooks from a remote SharePoint server that requires documents to be checked out before editing. So far I've been able to access the documents without issue which lets me know that the paths are correct at least - but it's always "Ready Only".
Here is an example of what I'm attempting to do. Based on the hours that I've spent searching the web, this little snippet of code should work without issue but it never gets past the IF statement because I "cannot checkout this document". I then thought perhaps it was permissions on the document itself in SharePoint, but I double checked and I have full permissions. I'm also able to manually check the documents out and check them back in.
The SharePoint is a secure (HTTPS) server, could that cause any issues checking a doc out? I've tried other ways to get the document out for editing, but I don't think I can get around the SharePoint library requirement to have documents checked out before editing.
I'm out of ideas. Anyone have any suggestions? And yes, I've double checked and the document is checked in on SharePoint.
Thanks in advance.
Excel 2007
Here is an example of what I'm attempting to do. Based on the hours that I've spent searching the web, this little snippet of code should work without issue but it never gets past the IF statement because I "cannot checkout this document". I then thought perhaps it was permissions on the document itself in SharePoint, but I double checked and I have full permissions. I'm also able to manually check the documents out and check them back in.
The SharePoint is a secure (HTTPS) server, could that cause any issues checking a doc out? I've tried other ways to get the document out for editing, but I don't think I can get around the SharePoint library requirement to have documents checked out before editing.
I'm out of ideas. Anyone have any suggestions? And yes, I've double checked and the document is checked in on SharePoint.
Code:
'Example calling of function
URL = //SharePoint_Server/Directory/workbook.xlsx
set wb = CheckOutWorkbook(URL)
Function CheckOutWorkbook(sPath As String) As Workbook
Dim wbWorkBook As Workbook
If Workbooks.CanCheckOut(sPath) = True Then
'Checkout Workbook for Editing
Workbooks.CheckOut sPath
'Open Workbook
Set wbWorkBook = Workbooks.Open(sPath, , False)
'Return Workbook
Set CheckOutWorkbook = wbWorkBook
Else
MsgBox ("Unable to checkout the workbook at this time")
End
End If
End Function
Thanks in advance.
Excel 2007
Last edited: