locked
Update PPT Charts from Excel is not working for MS Office Standard Version RRS feed

  • Question

  • Hello!

    I have a code that puts data from Excel into PowerPoint to update a Chart. The data is put into the excel file that lies behind the chart. After closing the excel file the chart is updated and everything is fine.

    In our company we work with different office versions and this works perfectly for

    MS Office Home and Business 2016

    MS Office Professional 2019

    MS Office Professional Plus 2016

    But not for MS Standard 2019. In this case the charts just get not updated. The code we are using to accomplish this is:

    Sub Chart_copy_gs(ByRef objpresentation As PowerPoint.Presentation, ByVal blattname As String, ByVal slideNr As Integer, ByVal chartName As String)
       
        Set ObjSlide = objpresentation.Slides(slideNr)
        ObjSlide.Select
        Set mychart = ObjSlide.Shapes(chartName).Chart
        
            Set wb = mychart.ChartData.Workbook
            Set WS = wb.Worksheets(1)
        
            WS.Range("A1:F40").ClearContents
            WS.Range("A1:F40").value = ThisWorkbook.Worksheets(blattname).Range("A45:F82").value
            
           wb.Close True
            
        Set ObjSlide = objpresentation.Slides(slideNr)
        Set mychart = ObjSlide.Shapes(chartName).Chart
         
            Set wb = mychart.ChartData.Workbook
            Set WS = wb.Worksheets(1)
            
            WS.Range("A1").ClearContents
        
        wb.Close True
        
    End Sub

    But the problem cannot lie within the code since it works fine for the above mentioned versions of office. Anyone who has an idea what the problem could be here?

    Best

    Wednesday, November 4, 2020 9:32 AM