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

CRHAAG

New Member
Joined
Jul 3, 2014
Messages
39
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
 

Some videos you may like

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
75,913
Office Version
  1. 365
Platform
  1. Windows
Where are you opening the file from?
 

Watch MrExcel Video

Forum statistics

Threads
1,113,823
Messages
5,544,538
Members
410,619
Latest member
gregor222
Top