VBA(Powerpoint) - 如何将图表对象添加到幻灯片

时间:2017-11-05 17:30:14

标签: vba powerpoint-vba

我在powerpoint中有以下VBA代码:

Dim xlApp As Object
Dim sourceWB As Workbook
Dim sourceWS As Worksheet
Dim chartObj As ChartObject

Set xlApp = CreateObject("Excel.Application")
With xlApp
 .Visible = True
 .EnableEvents = False
End With

Set sourceWB = xlApp.Workbooks.Open("path\\file.xlsx", , False, , , , , , , True)
Set sourceWS = sourceWB.Worksheets("ChartDump")

Set chartObj = sourceWS.ChartObjects(1)

如何将chartObj添加到我的某个幻灯片中?

工作表中的excel文档中有一个名为" ChartDump"

的图表

0 个答案:

没有答案