How to open a Powerpoint file from VB 2010?

peterkentt's Avatar, Join Date: Jun 2012
Newbie Member
This is what I'm doing: (using VB 2010 Express)

Dim showFile as Double

showFile = Shell("C:\...POWERPNT.EXE /S C:\Users\MyName\Folder with Files\" & _
"pptFile.ppsx", vbNormalFocus)


When I execute the program a message says:

"PowerPoint cannot read: C:\Users\MyName\Folder ."

then I click OK on the message box and it continues:

"PowerPoint cannot read: with Files\pptFile.ppsx"


Clearly there's something with the folder's name. I've already defined a variable String for the full file's name and then concatenated; no help.

Please help!

This is my first post in this Forum. Forgive any mistakes. Glad to be here!

Peter
0
Scripting's Avatar, Join Date: Jun 2010
John Hoder
have you tried using the folder the name of which is without any spaces?
0
peterkentt's Avatar, Join Date: Jun 2012
Newbie Member
Thank you!

That was the matter! Folders' names cannot have spaces.
0
Scripting's Avatar, Join Date: Jun 2010
John Hoder
Quote:
Originally Posted by peterkentt View Post
Thank you!

That was the matter! Folders' names cannot have spaces.
Your welcome