View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
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