Another problem..Open pps from form

B

Billy B

I have been at this now for about four days. I am using Access and PPT 2002
and want to open a powerpoint pps file from a timer event. The timer works
fine. Below is the code I have developed so far.

If timeDif >= 60 And blnPowerPointIsOpen = False Then

blnPowerPointIsOpen = True

Dim path As String
path = "C:\Documents and Settings\Wally\Desktop\Testing Hawleys
DB\test_ScreenSaver.pps"

Dim MyPP As Powerpoint.Application
Dim pres As Powerpoint.presentation
Dim MyPP As presentation
Set MyPP = New Application
MyPP.Visible = True
MyPP.WindowState = ppWindowMaximized
Set pres = MyPP.Presentations.Open(path)

End If

I get an error message on the line.

Dim MyPP As Powerpoint.Application

Checking on the internet, it looks like this should work.

PS. I have also created a macro, used the RunApp action with the following
in the command line: "PowerPnt.exe" "C:\Testing.pps" and get an error message
that it cant find the pps file. It is there, and when I exit the code PPT is
opened with the slides showing in the edit mode, not the show.

I have tried and any help is greatly appreciated.

Thank you all for your help
 
T

Tom van Stiphout

On Thu, 23 Oct 2008 23:13:02 -0700, Billy B

There is no point in running code that does not compile. Code window >
Debug > Compile. It will highlight the line "Dim MyPP As
Powerpoint.Application"
Reason is that that data type is not defined.
Select Tools > References and set a reference to Microsoft Powerpoint
<version> Object Library.
Compile again.
Fix the duplicate declaration. Fix the Set assignment.

This worked for me:
blnPowerPointIsOpen = True

Dim path As String
path = "C:\test.pps"

Dim MyPP As PowerPoint.Application
Dim pres As PowerPoint.Presentation
Set MyPP = New PowerPoint.Application
MyPP.Visible = True
MyPP.WindowState = ppWindowMaximized
Set pres = MyPP.Presentations.Open(path)

-Tom.
Microsoft Access MVP
 

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