Can't Open Powerpoint

O

Owen Wilson

Hello

I have a command button on a form that, when pushed,
opens up a Powerpoint slideshow that displays relevent
documents. I have used similar code before and it worked,
on a new database, it won't.

Here's the code I am using:

Private Sub cmdViewDR_Click()
Dim StrFilename As String 'create variable

Screen.PreviousControl.SetFocus

StrFilename = "C:\Documents and Settings\Owen
Wilson\Desktop\PBI\Job Folders\Santee Coop\DR\" &
DR_NUM.Text & ".ppt"


Dim ppt As Object

Set ppt = CreateObject("PowerPoint.Application.9")
ppt.Visible = True
ppt.Presentations.Open StrFilename

ppt.ActivePresentation.SlideShowSettings.Run
Set ppt = Nothing

Exit_CommandView_Click:
Exit Sub

End Sub

I continue to get a run time error saying powerpoint
could not open the file.

The pathname in the watch windoe for Strfilename is
correct.

I'm at my wits end as to why this same code works
somewhere else, but not here.

Any insight, suggestions...anything, would be greatly
appreciated.

TIA

Owen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top