Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
Was wondering if anyone could help me out. I am trying to open a new point file or an existing powerpoint file based on a user's input from the UserForm. Problem I am having is with the below line: "PPApp.Presentations.Open Filename:=Enginename" I cannot seem to open the powerpoint file using a variable name. Can anyone help? Thanks. Below is the full code that I have. Any help making this simple would also be appreciated. :) Sub ShowUserForm() Dim Enginename As Variant Dim Template As Variant Dim oPPt As Object Dim PPSlide As Object Dim PPApp As Object Dim PPPres As Object Dim SlideCount As Long PptTemplate.Show If PptTemplate.NewPpt.Value = True Then Set oPPt = CreateObject("PowerPoint.Application") oPPt.Visible = True oPPt.Presentations.Add Set PPApp = GetObject(, "Powerpoint.Application") Set PPPres = PPApp.ActivePresentation SlideCount = PPPres.Slides.Count Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank) PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex PptTemplate.Hide ElseIf PptTemplate.TemplatePpt.Value = True Then Enginename = PptTemplate.TemplatePpt.Value Application.GetOpenFilename("Powerpoint Files (*.ppt), .ppt", , "Please choose Powerpoint Template for presentation", , True) = Enginename If TypeName(Enginename) = "Boolean" Then MsgBox "You have chosen to cancel the process! The application will end. Please restart the application!", vbExclamation, "Information" Else Set oPPt = CreateObject("PowerPoint.Application") oPPt.Visible = True Set PPApp = GetObject(, "Powerpoint.Application") PPApp.Presentations.Open Filename:=Enginename End If PptTemplate.Hide End If End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
this line is backwards:
Application.GetOpenFilename("Powerpoint Files (*.ppt), .ppt", , "Please choose Powerpoint Template for presentation", , True) = Enginename Enginename = Application.GetOpenFilename() -- Regards, Tom Ogilvy "Mithi_M" wrote in message om... Hi all, Was wondering if anyone could help me out. I am trying to open a new point file or an existing powerpoint file based on a user's input from the UserForm. Problem I am having is with the below line: "PPApp.Presentations.Open Filename:=Enginename" I cannot seem to open the powerpoint file using a variable name. Can anyone help? Thanks. Below is the full code that I have. Any help making this simple would also be appreciated. :) Sub ShowUserForm() Dim Enginename As Variant Dim Template As Variant Dim oPPt As Object Dim PPSlide As Object Dim PPApp As Object Dim PPPres As Object Dim SlideCount As Long PptTemplate.Show If PptTemplate.NewPpt.Value = True Then Set oPPt = CreateObject("PowerPoint.Application") oPPt.Visible = True oPPt.Presentations.Add Set PPApp = GetObject(, "Powerpoint.Application") Set PPPres = PPApp.ActivePresentation SlideCount = PPPres.Slides.Count Set PPSlide = PPPres.Slides.Add(SlideCount + 1, ppLayoutBlank) PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex PptTemplate.Hide ElseIf PptTemplate.TemplatePpt.Value = True Then Enginename = PptTemplate.TemplatePpt.Value Application.GetOpenFilename("Powerpoint Files (*.ppt), .ppt", , "Please choose Powerpoint Template for presentation", , True) = Enginename If TypeName(Enginename) = "Boolean" Then MsgBox "You have chosen to cancel the process! The application will end. Please restart the application!", vbExclamation, "Information" Else Set oPPt = CreateObject("PowerPoint.Application") oPPt.Visible = True Set PPApp = GetObject(, "Powerpoint.Application") PPApp.Presentations.Open Filename:=Enginename End If PptTemplate.Hide End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
updating embedded powerpoint in excel file | Excel Discussion (Misc queries) | |||
Need to copy chart of excel to powerpoint file without the other s | Charts and Charting in Excel | |||
Hyperlink from Excel to Powerpoint file opens as slideshow, why? | Excel Discussion (Misc queries) | |||
links to a powerpoint file in excel | Excel Discussion (Misc queries) | |||
Opening a new PowerPoint chart with excel vba | Excel Programming |