Could you please tell me how to add (Create) the combobox in powerpoint using VBA?
I tried to use the following code. But getting compile error- Method or data memeber not found.
PHP Code:
Set OleObj = newPowerPoint.ActivePresentation.Slides.OLEObjects.Add
Please help
PHP Code:
Sub GatePowerPoint()
'Call CreatePowerPoint.CreatePowerPoint Dim PPSlide As PowerPoint.Slide
Dim newPowerPoint As PowerPoint.Application Dim activeSlide As PowerPoint.Slide Dim cht As Excel.ChartObject Dim myShape As Object
Dim PPT As PowerPoint.Application Set PPT = New PowerPoint.Application PPT.Visible = True 'PPT.Presentations.Open Filename:="D:\DU Dashboard Template.pptx" 'Look for existing instance 'On Error Resume Next Set newPowerPoint = GetObject(, "PowerPoint.Application") 'On Error GoTo 0
'Let's create a new PowerPoint If newPowerPoint Is Nothing Then ' Set newPowerPoint = New PowerPoint.Application
End If
'Make a presentation in PowerPoint If newPowerPoint.Presentations.Count = 0 Then newPowerPoint.Presentations.Add ' End If
'Add a new slide where we will paste the chart newPowerPoint.ActivePresentation.Slides.Add newPowerPoint.ActivePresentation.Slides.Count + 1, ppLayoutText newPowerPoint.ActiveWindow.View.GotoSlide newPowerPoint.ActivePresentation.Slides.Count Set activeSlide = newPowerPoint.ActivePresentation.Slides(newPowerPoint.ActivePresentation.Slides.Count)
'Show the PowerPoint newPowerPoint.Visible = True
'Paste to PowerPoint and position
Dim pp As Object Dim PPPres As Object
Dim Rng As Range
Set PPSlide = PPT.ActiveWindow.View.Slide Set PPApp = GetObject(, "PowerPoint.Application") On Error GoTo 0
PPApp.Visible = True PPApp.ActiveWindow.ViewType = ppViewSlide Set PPPres = PPApp.ActivePresentation
TempPath = Application.TemplatesPath 'Const strFolder As String = TempPath
Dim StrFile As String, Path As String, FileName As String
Dim i As Integer Dim shp As PowerPoint.Shape 'Dim shp As PowerPoint.TextBox Dim sld As Slide Set shp = PPSlide.Shapes.AddTextbox(msoShapeRectangle, 10, 10, 200, 100) 'Set shp = PPSlide.Shapes.AddShape(35, 10, 10, 5.0399, 8.6399) 'shp.Fill.ForeColor.RGB = RGB(137, 143, 75) 'shp.Fill.BackColor.RGB = RGB(137, 143, 75)
'test Set OleObj = newPowerPoint.ActivePresentation.Slides.OLEObjects.Add (ClassType:="Forms.ComboBox.1", _ Link:=False, _ DisplayAsIcon:=False, _ Left:=53, _ Top:=44.5, _ Width:=115, _ Height:=15) OleObj.Name = "UCLpar" ' ' Capture select user option in another module '
Bookmarks