Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to open Powerpoint file from Access

Status
Not open for further replies.

paradiso

Programmer
Apr 18, 2002
60
US
Friends,

When my user double-clicks a file name in a list control, I create an instance of the appropriate application and open the file, based on the extension (.doc, .xls, .ppt).

This works when I open Word and Excel, but when I try to open a Powerpoint presentation, I get the following run time error

Presentation (unknown member): Invalid request.
The PowerPoint Frame Window does not exist.

Here is the code snippet:


Case "ppt":
Dim appPPT As PowerPoint.Application
Set appPPT = New PowerPoint.Application
appPPT.Presentations.Open FileName:=FileorPathName
appPPT.Visible = True

Thanks in advance.
p
 
Just by looking at your code this line is not corrrect VBA syntax

FileName:=FileorPathName

change it to this for example
FileName="c:\yourfolder\yourfile.ppt"


DougP, MCP, A+
 
Hi there,

I neglected to indicate that FileorPathName is a variable that represents the full path to the file, as selected from a browse interface by the user.

Just for laughs, I tried hard coding the path, as in

appPPT.Presentations.Open "D:\StrategyDB\Testing.ppt"

Still the same error.

Thank you for your response all the same.

p
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top