Hello,

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 StringPath As StringFileName As String

Path 
TempPath
FileName 
"*.potm"
StrFile Dir(Path FileName)

   
    
TempPath TempPath StrFile
    
    PPPres
.ApplyTemplate TempPath
  
'  PPPres.Slides.Add PPPres.Slides.Count + 1, ppLayoutCustom
    PPSlide.Shapes.Title.Delete
    '
PPSlide.Shapes.Title.Delete


PPSlide
.Shapes(1).Delete


    
Sheets
("Draft Status Report").Range("H1:T3").Copy
    PPSlide
.Shapes.PasteSpecial(ppPasteEnhancedMetafile).Select
                 
'PPSlide.ApplyTemplate [Knorr-Bremse]
                 

    
    
    
    
    '
Center pasted object in the slide
   
'newPowerPoint.ActiveWindow.Selection.ShapeRange.Top = 150
  ' 
newPowerPoint.ActiveWindow.Selection.ShapeRange.Left 2
    With newPowerPoint
.ActiveWindow.Selection.ShapeRange
            
.LockAspectRatio True
        
.Top ' points
        .Left = 20
      ' 
.Width 715
        
.Height 40
    End With




    
''    ActivePresentation.ApplyTemplate [Knor-Bremse]
'Sheets("Start Page").Range("B19:E25").Copy
'    
PPSlide.Shapes.PasteSpecial(ppPasteEnhancedMetafile).Select
'                 'PPSlide.ApplyTemplate [Knorr-Bremse]
'
'
'
'
'
'
'    '
Center pasted object in the slide
'   newPowerPoint.ActiveWindow.Selection.ShapeRange.Top = 150
'   
newPowerPoint.ActiveWindow.Selection.ShapeRange.Left 2
'    With newPowerPoint.ActiveWindow.Selection.ShapeRange
'            
.LockAspectRatio True
'        .Top = 50 ' points
'        .Left = 3
'       
.Width 715
'      '  .Height 250
'    End With
    
Dim i As Integer
    Dim shp As PowerPoint.Shape
    '
Dim shp As PowerPoint.TextBox
    Dim sld 
As Slide
Set shp 
PPSlide.Shapes.AddTextbox(msoShapeRectangle1010200100)
    
'Set shp = PPSlide.Shapes.AddShape(35, 10, 10, 5.0399, 8.6399)
    '
shp.Fill.ForeColor.RGB RGB(13714375)
    
'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
'





    
    
    
'
Header Copy
ThisWorkbook
.ActiveSheet.Range("A38:U65").Copy
    PPSlide
.Shapes.PasteSpecial(ppPasteEnhancedMetafile).Select
                 
'PPSlide.ApplyTemplate [Knorr-Bremse]
                 

    
    
    
    
    '
Center pasted object in the slide
   
'newPowerPoint.ActiveWindow.Selection.ShapeRange.Top = 150
  ' 
newPowerPoint.ActiveWindow.Selection.ShapeRange.Left 2
    With newPowerPoint
.ActiveWindow.Selection.ShapeRange
            
.LockAspectRatio True
        
.Top 65 ' points
        .Left = 3
       .Width = 715
        '
.Height 250
    End With
    
'Header copy end


'
Champion Comment
ThisWorkbook
.ActiveSheet.Range("A66:U71").Copy
    
'PPSlide.Shapes.PasteSpecial(ppPasteEnhancedMetafile).Select
    '
PPSlide.Shapes.PasteSpecial DataType:=0

    
'Set myShape = mySlide.Shapes(mySlide.Shapes.Count)
                 '
PPSlide.ApplyTemplate [Knorr-Bremse]
Set PPSlide PPPres.Slides.Add(1ppLayoutTitleOnly)
PPSlide.Application.ActiveWindow.View.PasteSpecial DataType:=ppPasteDefault

    
    
    
    
    
'Center pasted object in the slide
   '
newPowerPoint.ActiveWindow.Selection.ShapeRange.Top 150
  
' newPowerPoint.ActiveWindow.Selection.ShapeRange.Left = 2
    With newPowerPoint.ActiveWindow.Selection.ShapeRange
            .LockAspectRatio = False
        .Top = 435 ' 
points
        
.Left 3
       
.Width 715
       
' .Height = 120
    End With
    
'
Header copy end


'Header Copy



   
    
    
Application.CutCopyMode = False
    Set activeSlide = Nothing
    Set newPowerPoint = Nothing
     
End Sub 
Thank you..