2016-12-15 50 views
0

使用VBA更新PowerpPoint 2016中的Powerpoint(非嵌入式Excel圖表)後,當我右鍵單擊圖表並選擇編輯數據時,圖表不再允許編輯數據。如果我選擇圖表上部rHS上的過濾器符號,則會出現此錯誤。PowerPoint 2016圖表在VBA更新後丟失數據表

鏈接文件不可用於編輯鏈接。點擊編輯鏈接 以下文件。

超級鏈接點擊它後什麼都不做。

這是用於更新圖表

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 

回答

0

後搜索和試驗的天代碼,我發現我的問題的解決方案。我沒有創建幻燈片或圖表,並發現數據在數據表的表格中。我在Excel工作表中編輯數據並將表格轉換爲一個範圍。

奇怪的是,這解決了我的問題。