Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Opening Powerpoint file from Excel

Hi -

I have the following code to start a new instance of Powerpoint when
the value in Cell A1 is greater than 10:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Excel.Range)

If Range("A1").Value 10 Then
Application.ActivateMicrosoftApp (xlMicrosoftPowerPoint)
End If

End Sub


How can I adapt this code to specify which file to open in Powerpoint?
It will always be the same file so I can hard code the filename into my
macro, something like 'C:\My Folder\My Presentation.ppt

Thanks in advance

Jake

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Opening Powerpoint file from Excel

Jake,

Try this

Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)
Dim oPPT as Object

If Range("A1").Value 10 Then
Set oPPT = GetObject("C:\My Folder\My Presentation.ppt")
oPPT.Parent.Parent.Visible = True
End If

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"JakeyC" wrote in message
ps.com...
Hi -

I have the following code to start a new instance of Powerpoint when
the value in Cell A1 is greater than 10:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Excel.Range)

If Range("A1").Value 10 Then
Application.ActivateMicrosoftApp (xlMicrosoftPowerPoint)
End If

End Sub


How can I adapt this code to specify which file to open in Powerpoint?
It will always be the same file so I can hard code the filename into my
macro, something like 'C:\My Folder\My Presentation.ppt

Thanks in advance

Jake



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Opening Powerpoint file from Excel

Thanks for your help.
That certainly opens Powerpoint but not the actual show, just the
program. Any ideas why it may not work?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Opening Powerpoint file from Excel

Do you mean launching into Powerpoint Viewer?

--

HTH

RP
(remove nothere from the email address if mailing direct)


"JakeyC" wrote in message
ups.com...
Thanks for your help.
That certainly opens Powerpoint but not the actual show, just the
program. Any ideas why it may not work?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Opening Powerpoint file from Excel

Yes, I'd like it to start the show. I realise my '.ppt' extension was
misleading - the one I used in the end was '.pps', however both seem to
launch an empty powerpoint.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 414
Default Opening Powerpoint file from Excel

Hi Jake

If you set a reference to the Microsoft Powerpoint Object Library then
you could try it like this:

Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Target As Excel.Range)

If Range("A1").Value 10 Then

Dim ppApp As PowerPoint.Presentation

Set ppApp = GetObject("C:\temp\pptShow.pps")
ppApp.SlideShowSettings.Run

End If
End Sub

Hope this helps
Rowan

JakeyC wrote:
Yes, I'd like it to start the show. I realise my '.ppt' extension was
misleading - the one I used in the end was '.pps', however both seem to
launch an empty powerpoint.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Opening Powerpoint file from Excel

Just run the show then, add

oPPT.SlideShowSettings.Run

at the end.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"JakeyC" wrote in message
ups.com...
Yes, I'd like it to start the show. I realise my '.ppt' extension was
misleading - the one I used in the end was '.pps', however both seem to
launch an empty powerpoint.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to open Excel file from PowerPoint? Bob H[_3_] Excel Programming 4 July 17th 05 01:44 AM
Help in opening powerpoint file variable from excel Mithi_M Excel Programming 1 August 1st 04 04:33 PM
Opening a new PowerPoint chart with excel vba KDUT Excel Programming 1 May 15th 04 04:39 AM


All times are GMT +1. The time now is 08:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"