Problem Capturing Network File Path

frank_AL

Active Member
Joined
Oct 30, 2015
Messages
471
I am trying to use the VBA .Path command below to capture the Folder after opening a file.
FileFldr = CurrmonthWB.path
What I am gettting is: (I've changed a couple of items to hide personal info)
"https://techinccom-my.sharepoint.com/personal/myname_techinc_com/Documents/Documents/Pre-Commission Project/2024 Monthly Files/2024-12 December"

If I use File Explorer to view that same network folder I get: (I've changed a couple of items to hide personal info)
C:\Users\myname\OneDrive - Tech, Inc\Documents\Pre-Commission Project\2024 Monthly Files\2024-12 December
If I allow the user to select the Default Folder and then store what they select I get the correct Folder information which is the second version (previous line)

Later in the program when I try to access that FileFldr (first version) I get an error message.

Any ideas on how to get it to capture the correct Folder information?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Note the slashes in the two versions. The first version is a url (web address) so it is not local as is C:\
If you can map to the sharepoint server then use that network address. Its server name will begin with two slashes: \\
You may need IT help to determine what its network address is and/or whether or not you can attach to it as a network drive. I say that because perhaps you are in another town or whatever, and there is no way for you to map to it same as you would any other network drive.

Failing that, there may be a way you can make use of the url in code but I'm afraid I don't know it.
 
Upvote 0
Note the slashes in the two versions. The first version is a url (web address) so it is not local as is C:\
If you can map to the sharepoint server then use that network address. Its server name will begin with two slashes: \\
You may need IT help to determine what its network address is and/or whether or not you can attach to it as a network drive. I say that because perhaps you are in another town or whatever, and there is no way for you to map to it same as you would any other network drive.

Failing that, there may be a way you can make use of the url in code but I'm afraid I don't know it.
Micron,
Thank you for your response. You are right about me being in another town. The company I am doing work for has sent me one of their computers and I am connected to their network drive. I'm with you that I don't know how to convert that url.
 
Upvote 0
I'm with you that I don't know how to convert that url.
If you can map or are mapped to a network drive when you are remote then you should be able to map to the sharepoint server. You just need to know what the network address is. If you need to write code that accesses the sp server but can't map to it, you can still write code that uses the network path. You just won't be able to test it if you're not mapped to that drive. If there is a way to use the url instead for what you're doing then I don't know it.
 
Upvote 0

Forum statistics

Threads
1,225,626
Messages
6,186,095
Members
453,337
Latest member
fiaz ahmad

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top