1

What I am trying to do is open file dialog in a network path. I have figured out how to open it in the correct location, but it sets itself up as a website.

Here is the code:

Set files = Application.FileDialog(3) '3 is the File Picker type
    files.InitialFileName = "https://website.com/pathing/Document/"
    'files.InitialFileName = "\\website.com@SSL\pathing\Document\"
    files.AllowMultiSelect = True
    files.Show

Both lines that set the initial file name act exactly the same.

When I run the code I am unable to select more than one file. Unwanted Behavior

 

However, when I manually type in the pathing \\website.com@SSL\pathing\Document\ the File Dialog behaves as I want it to, allowing me to select multiple files. Desired Behavior

 

Is there a way for me to get directly to the intended behavior without having to manually enter it into the explorer bar?

Thank you.

1 Answers1

1

If you want to access this directly, you need to tell the explorer that its dealing with webDav, which in fact SharePoint does if you open a library in an explorer view.

So the path to your library is https://website.com/pathing/Document/

So the UNC path looks like this:

\\website.com\davWWWroot\pathing\document\

You can however get the correct path all by yourself if you follow these steps:

  1. Open the path in a browser
  2. Switch to explorer view
  3. Copy the address in the explorer
  4. Map a network drive with the copied address.
  5. The network drive has the desired UNC path for you.
Marco
  • 22,856
  • 9
  • 75
  • 124
  • The problem isn't being able to get to the right location. (I am in fact getting to the desired location). But when I open up the location through vba, it defaults to the view seen in the first link I posted and it does not allow me to select more than one file at a time. However, if I click directly on the address line in the file explorer and type in the path "\\website.com\pathing\document\", it behaves as desired and lets me select multiple files. – Andrew Meagher Feb 19 '15 at 15:48
  • Have you used davWWWroot in your path? – Marco Feb 19 '15 at 16:01
  • Yes, and it still behaves the same way. – Andrew Meagher Feb 19 '15 at 16:17
  • @Andrew Meagher Did you ever solve the problem? I have the same issue with every application that uses the FileDialog. – IngoB Jan 06 '21 at 18:03