none
Powerpoint run-time error 429 RRS feed

  • Question

  • Hi,

    I'm running the following code from an excel macro to insert a slide(s) into a new powerpoint presentation based on a list of filenames in the spreadsheet.

    The line that I'm sure is causing me grief is the one with the Insertfilefrom statement.

    Appreciate any help available.

    Cheers

    Nathan

     'Loop through each cell in the Excel worksheet and paste the corresponding slide into the PowerPoint
            Sheets("presentation").Select
            
            Range("a1").Select
            
            Do Until IsEmpty(ActiveCell)
            
            Dim FilName As String
            
            FilName = "p:\product presentations\nathan\" & ActiveCell.Value & ".pptx"
            'FilName = "p:\product presentations\nathan\gb7007.pptx"
            
            'Add a new slide where we will paste the chart
                newPowerPoint.ActivePresentation.Slides.Add newPowerPoint.ActivePresentation.Slides.Count + 1, ppLayoutBlank
                newPowerPoint.ActiveWindow.View.GotoSlide newPowerPoint.ActivePresentation.Slides.Count
                Set activeSlide = newPowerPoint.ActivePresentation.Slides(newPowerPoint.ActivePresentation.Slides.Count)
            '
            'Insert the slide or if not exist note on blank slide
                
             If Dir(FilName) <> "" Then
                 ActivePresentation.Slides.InsertFromFile FilName, 0
             Else
                activeSlide.Shapes.AddTextbox(msoTextOrientationHorizontal, 100, 100, 200, 50).TextFrame.TextRange.Text = ActiveCell.Value
            End If
            
            
            ActiveCell.Offset(1, 0).Select
            
            Loop

    Monday, January 15, 2018 3:04 AM