Solved

Open power point presentation from ACCESS 2003 VBA

Posted on 2011-09-06
13
415 Views
Last Modified: 2012-05-12
How does one open a power point presentation from Access 2003 via VBA?  I have a trainging presentation that I want user to be able to open from a button on an ACCESS 2003 form.  The power point is in version 2010.
0
Comment
Question by:ssmith94015
  • 6
  • 3
  • 3
  • +1
13 Comments
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 36490149
I generally use the Application.Followhyperlink method.  All you need to add to that is the path and file name.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36490169
Yes, if all you need to do is "Open" the PP file then fyed has your answer here.

If you need anything special (Open parameters, run slide show automatically, ...etc) then you will need "Interoperability" code.

JeffCoachman
0
 

Author Comment

by:ssmith94015
ID: 36490171
Ok, this did open it, but it opened it in design view.  Maybe I did not make myself clear and sorry about that, but I want the user to hit the button and have the presentation start running.  
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 5

Expert Comment

by:MAdS
ID: 36490210
Try this:

Const SW_SHOW = 1
Const SW_SHOWMAXIMIZED = 3

Public Declare Function ShellExecute Lib "Shell32.dll" Alias "ShellExecuteA" _
 (ByVal hwnd As Long, _
  ByVal lpOperation As String, _
  ByVal lpFile As String, _
  ByVal lpParameters As String, _
  ByVal lpDirectory As String, _
  ByVal nShowCmd As Long) As Long

Sub OpenFile()
 On Error Resume Next
 Call ShellExecute(0, "open", "[file-name]", , "[file-folder]", SW_SHOWMAXIMIZED)
End Sub 

Open in new window

0
 
LVL 5

Expert Comment

by:MAdS
ID: 36490228
P.S.: have you presentation saved as PPSX, not PPTX
0
 

Author Comment

by:ssmith94015
ID: 36490355
Ok, it keeps crashing my system.
0
 

Author Comment

by:ssmith94015
ID: 36490377
Now I get argument not optional
Sub OpenPowerPoint()
 On Error Resume Next
 Call ShellExecute(0, "open", "ProjectTaskTraining.ppsx", , "K:\DatabaseDevelopment\ProjectTaskTracking\", SW_SHOWMAXIMIZED)
End Sub
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 36490556
What keeps crashing your system?

If you save the file as a ppsx, as indicated by MAdS, then the followhyperlink method should work just fine.

If you don't like that method, create subroutine that will open PPT, then the file, then display the slideshow

Try this:

Public Sub ppt(FileName As String)

    Dim ppt As Object
    Dim pres As Object
    Dim ss As Object

    Set ppt = CreateObject("Powerpoint.Application")
    ppt.Visible = True
    Set pres = ppt.Presentations.Open(FileName)
    Set ss = pres.slideshowsettings.Run

    Set ss = Nothing
    Set pres = Nothing
    Set ppt = Nothing

End Sub
0
 

Author Comment

by:ssmith94015
ID: 36490591
System crashes when I try to run the code.  I will try your version fyed and see what happens.
0
 

Author Closing Comment

by:ssmith94015
ID: 36490618
Thank you, this worked.  The other seemed logical as far as I could tell, but my system just did not like it.

Sandra
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 36490654

Did you even try:

Application.FollowHyperlink "K:\DatabaseDevelopment\ProjectTaskTracking\ProjectTaskTraining.ppsx"
0
 

Author Comment

by:ssmith94015
ID: 36490885
Yes I did, it was the first thing, but again, for whatever reason, my system would not process.  I am happy with what I have now.
0
 
LVL 5

Expert Comment

by:MAdS
ID: 36492228
Just FYI, I skipped 4th parameter. It should be:

Sub OpenPowerPoint()
 On Error Resume Next
 Call ShellExecute(0, "open", "ProjectTaskTraining.ppsx", "", "K:\DatabaseDevelopment\ProjectTaskTracking\", SW_SHOWMAXIMIZED)
End Sub
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
IIF help, YN field 7 22
Using LPR to print to IP Barcode printers VBA MS Access 11 19
Switch 5 18
Advice on Listbox or Listview usage 3 19
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question