FSO can't navigate to SharePoint address until manually navigated in WE (AC2007) (1 Viewer)

AOB

Registered User.
Local time
Today, 11:05
Joined
Sep 26, 2012
Messages
615
Hi there,

I have an import process which, among other things, connects to a SharePoint site to take a copy of a file (saved down each day) and import it into my own DB via a staging table.

I've added error handling to account for the possibility that a) the user does not have the necessary access to the SharePoint site or b) the daily file has not yet been uploaded to the site.

This is how I test for the existence of the file :

Code:
Dim objFSO As Object
 
Set objFSO = CreateObject("Scripting.FileSystemObject")
 
If Not objFSO.FileExists(strPath) Then
 
    DoCmd.OpenForm "frmSharePointError", acNormal, , , , acDialog, _
    objFSO.GetParentFolderName(strPath) & "\"
 
    GoTo NextDate
 
End If
 
Set objFSO = Nothing

strPath is derived from a base directory (i.e. \\sharepoint.domain.com\sites\etc.) and the mask of the file. The error form is a simple popup which displays the path (sent as OpenArgs) to allow the user to copy and paste into Windows / Internet Explorer and validate whether or not they have access, or arrange an access request.

However, I often (but not always) get the same popup error on my own machine, even though I do have the relevant permissions. And when I paste the path into Windows Explorer, I can see the directory and the file. Having done this, if I run the subroutine again, it works. And (I think) it continues to work until I shut down my PC.

So it's as if the FSO can't navigate to the URL until I've manually performed the navigation in WE. And then it can. Which is weird?

Any thoughts as to how I might prevent this happening? I don't want my end users to have to run the same routine twice each day (or each time they log off, which could potentially be every day?)

Thanks

AOB
 

Users who are viewing this thread

Top Bottom