VBA File Path Issue - Sharepoint

dw1256

New Member
Joined
Jun 27, 2022
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Hi There,

I am using the following to assign the workbooks path to myPath:

myPath = activeworkbook.path

When I do this, it assigns the sharepoint path:

https://name.sharepoint.com/sites/sitename/Shares/Acme/Global Documents/QPCG

I want the path in this format:

C:\Users\...........\Global Documents\QPCG

Is there an easy way to do this? If not, can I somehow convert it to what I am looking for?

Thanks.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Sync your sharepoint folder with your driver. You can do that from sharepoint
 
Upvote 0
Go to the folder on sharepoint. There should be a button on top which says “sync”
 
Upvote 0
Go to the folder on sharepoint. There should be a button on top which says “sync”
That didn't work. It is still pulling the Sharepoint address for the path.
 
Upvote 0
What if you run this macro. Just select your file and see which path is showing up.

VBA Code:
Sub jec()
 With Application.FileDialog(3)
   If .Show Then MsgBox .SelectedItems(1)
 End With
End Sub
 
Upvote 0
What if you run this macro. Just select your file and see which path is showing up.

VBA Code:
Sub jec()
 With Application.FileDialog(3)
   If .Show Then MsgBox .SelectedItems(1)
 End With
End Sub
This code does give the desired "C:\Users\..........." path.
 
Upvote 0
So you can work with this code right? .Selecteditems(1) provides you the path
 
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,048
Members
449,206
Latest member
Healthydogs

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