vba 在powerpoint中编辑图表数据
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23526566/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-12 03:01:48 来源:igfitidea点击:
edit chart data in powerpoint
提问by Hymanery Xu
I would like to edit the values of a chart within a powerpoint file. I can't seem to find the appropriate methods like .Range and .Cell anywhere.
我想在 powerpoint 文件中编辑图表的值。我似乎无法在任何地方找到合适的方法,如 .Range 和 .Cell 。
ActivePresentation.Slides(sl).Shapes(sh).Chart.DataTable
does not seem to have all the methods in the conventional DataTable method.
似乎没有常规DataTable方法中的所有方法。
回答by Dmitry Pavliv
Something like this should work:
这样的事情应该工作:
With ActivePresentation.Slides(sl).Shapes(sh).Chart.ChartData
.Activate
.Workbook.Sheets(1).Range("A1").Value = "test_data"
.Workbook.Close
End With