Question

I want to access an image file in my VBA code for PowerPoint 2011 for Mac. I have used both "/" and ":" as separator but it didn't work. It works only when I save both .pptm file and the image file in the same folder and specify the relative path for the image file as below: Dim strPath As String strPath = "image.png"

But if I try saving the file at a different location than the .pptm file and provide the full path for the StrPath as: strPath = "Users:Me:Desktop:image.png" it throws a runtime error saying "the specified file wasn't found". I have kept in mind the case sensitivity in case of Mac but nothing seems to be working for me. Can anyone please help me in finding the possible workaround so that I can save the .pptm file and the image file at different locations on Mac?

Was it helpful?

Solution

Try:

Presentations.Open "Macintosh HD:Users:Me:Desktop:filename.ext"

Substitute appropriate strings for the name of the HD, your user name and the file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top