我在C#项目中遇到了问题.事实上,我创建了一个PowerPoint加载项,我想在幻灯片上生成图表.
我创建了一张幻灯片:
using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using Microsoft.Office.Interop.Graph;
Microsoft.Office.Interop.Graph.Chart objChart;
objChart = (Microsoft.Office.Interop.Graph.Chart)objShape.OLEFormat.Object;`
Run Code Online (Sandbox Code Playgroud)
图表是在幻灯片上创建的,但我无法访问要更新或插入的数据.
我尝试使用如下的数据表:
//DataSheet test = objChart.Application.DataSheet;
//test.Cells.Clear()
Run Code Online (Sandbox Code Playgroud)
这删除了图表的数据,但我无法弄清楚如何将值重新插入到图表数据中.