小编use*_*369的帖子

在C#中访问PowerPoint图表

我在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)

这删除了图表的数据,但我无法弄清楚如何将值重新插入到图表数据中.

c# charts powerpoint office-interop

10
推荐指数
1
解决办法
5931
查看次数

标签 统计

c# ×1

charts ×1

office-interop ×1

powerpoint ×1