VBA更新后PowerPoint 2016图表丢失数据表

时间:2016-12-15 18:08:50

标签: powerpoint powerpoint-vba

在使用VBA更新PowerpPoint 2016中的Powerpoint(非嵌入式Excel图表)后,当我右键单击图表并选择编辑数据时,图表不再允许编辑数据。如果我在图表的上部rHS上选择过滤器符号,我会收到此错误。

  

链接文件无法编辑链接。点击编辑链接   到下面的文件。

超链接在点击后无效。

这是用于更新图表的代码

For Each oSH In ActivePresentation.Slides(2).Shapes

                oSH.Chart.SeriesCollection(1).values = "Sheet1!$B$1:$B" & maxrow  ' change the series range before opening and closing the workbook object
                oSH.Chart.SeriesCollection(1).XValues = "Sheet1!$A$1:$A" & maxrow  'max number showing is 6 data points

                    With oSH.Chart.ChartData

                            'this updates the values in the datasheet
                            .Workbook.sheets(1).Range("A1:B" & lrow - 2).Value = xlWorkBook.sheets(2).Range("A3:B" & lrow).Value

                    End With

1 个答案:

答案 0 :(得分:0)

经过几天的搜索和实验,我找到了解决问题的方法。我没有创建幻灯片或图表,发现数据在数据表的表格中。我在Excel工作表中编辑了数据并将表转换为范围。

奇怪的是,这解决了我的问题。