Powerpoint vba activepresentation.path showing sharepoint address instead of file path

CRHAAG

New Member
Joined
Jul 3, 2014
Messages
46
I am trying to write some code to get me a list of files in a folder. The folder will always sit in the same folder as my Powerpoint presentation. When I use activepresentation.path to get the name of the directory that the powerpoint sits in, I get this:
https://*companyName*-my.sharepoint.com/personal/chaag_*companyName*_com/Documents/tomFoolery/MAG Presentation

If I use CurDir() I get this:
C:\Users\chaag\Documents

The path that I want is this:
c:/users/chaag/onedrive - *companyName*/tomFoolery/MAG Presentation

My issue is that I am using
VBA Code:
Dir("c:/users/chaag/onedrive - Mid American Group/tomFoolery/MAG Presentation/photos/")
to loop through files in the folder and give me their names, but with the sharepoint address it does not work. I am happy with any solutions to allow me to use the sharepoint address or that can give me actual path on my computer
 

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.
Where are you opening the file from?
 
Upvote 0

Forum statistics

Threads
1,214,948
Messages
6,122,420
Members
449,083
Latest member
Ava19

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