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

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Norie

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

Watch MrExcel Video

Forum statistics

Threads
1,114,314
Messages
5,547,170
Members
410,775
Latest member
alal1030
Top