Hi,
I am working on a sub that would copy files to a SharePoint-location.
The code I attached is working fine in certain cases, but not always, and doesn't work at all for a colleague.
There is no permission issue, manually we both are able to copy files to there.
I learned, that there is a windows-component called web-agent that needs to be enabled when this copy is done, but cannot figure out how to check if it is enabled and how to enable it, if it is not.
According to my experience, starting internet explorer may start if I go to that location, but not always 
What I also do is add the "@SSL\DavWWWRoot" to the path.
Does anyone have some experience with it?
The errormessage I get is "Access denied" and says that the site should be added to the trusted sited, but it is there.
Here is my code (simplified for demonstration)
Sub sp()
Dim i As Long
Dim fso As Object
Dim msg As String
Dim sPath As String
Dim mFolder As Object
Dim sp As String
Dim md As String
Set fso = CreateObject("Scripting.FileSystemObject")
On Error GoTo eh
sPath = "\\xx.sharepoint.com@SSL\DavWWWRoot\sites\fld1\fld2\fld3\Shared Documents\folder name\"
If Not fso.folderexists(sPath & "testfolder") Then
fso.createfolder (sPath & "testfolder")
MsgBox "OK"
Else
MsgBox "already exists"
End If
Exit Sub
eh:
MsgBox "Error" & Err.Description
End Sub
Bookmarks