Can't find any forum threads that might have answer(s) to the difficulty I'm having trying to copy a file to a Sharepoint. In the app's settings we have this:
The code that accesses the URL from "Settings" and attempts the copy:
The one thing that makes this whole caper a bit difficult, at least from the standpoint of debugging, is that it's only the customer that has security to the Sharepoint. HOWEVER, when the user does a copy/paste of the URL expression you see above from "Settings" directly into her browser's address bar, the Sharepoint opens up normally. So, I expect the copy to fail on my machine, just not sure what error to receive, one about a path or more about security like enter user name and password for the Sharepoint.Code:Private Function UploadToSharepoint() As Integer Dim strShrPt As String Dim FS As Object On Error GoTo Err_Handler strShrPt = Nz(DLookup("SetShrPt", "QSettings")) If Len(strShrPt) = 0 Then MsgBox "No ""Sharepoint"" address found in ""Settings""" & vbNewLine & _ "Copy " & strLSName & " to ""Hub"" manually." Exit Function Else strShrPt = strShrPt & strTxtName End If Set FS = CreateObject("Scripting.FileSystemObject") If FS.FileExists(strLSName) Then FS.CopyFile strLSName, strShrPt UploadToSharepoint = 0 End If Exit_Handler: Exit Function Err_Handler: MsgBox "Error " & Err.Number & " copying " & strTxtName & " to ""RR Hub"" : " & Err.Description MsgBox strShrPt & vbNewLine & strShrPt UploadToSharepoint = Err.Number Resume Exit_Handler End Function
On my machine, I get either this error:
OR THIS ONE:
I can find nothing wrong with string configuration or the FS Object, though I don't have a whole lot of experience with the file system model. Any suggestions?
Thanks,
Bill