Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to open Excel file from PowerPoint? | Excel Programming | |||
Help in opening powerpoint file variable from excel | Excel Programming | |||
Opening a new PowerPoint chart with excel vba | Excel Programming |