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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
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
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,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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