删除子数据表
Remove Subdatasheet
我有一个 powerpoint presentation
和 diagrams
,其中图表的数据在 subdatasheet
中(双击图表时打开的那个)。
现在我想将 presentation
发送给客户,但不能更改 datasheet
中的数据,但可以 animations
。
所以只用 diagram
拍一张照片不是一种选择。
我试图删除 linkings
但没有成功。任何人都知道我如何在 vba
?
上完成此操作
编辑:
根据 R3uK's answer
我试过:
Sub Export_to_Ppt()
Dim myChart As PowerPoint.Chart
Set myChart = ActivePresentation.Slides(1).Shapes("Diagramm 1").Chart
myChart.ChartArea.Copy
ActivePresentation.Slides(ActivePresentation.Slides.Count).Shapes.PasteSpecial ppPasteEnhancedMetafile
End Sub
这是有效的,但对我来说,我得到了一张无法动画化的图片。
我使用这个基础将我在 PPT 中的图表导出为 Office Graphs (ppPasteEnhancedMetafile
):
Sub Export_to_Ppt()
'
Dim Ppt As PowerPoint.Application, _
Pres As PowerPoint.Presentation
Set Ppt = CreateObject("PowerPoint.Application")
Set Pres = Ppt.Presentations.Open("C:\Template.potx")
Ppt.Visible = True
Sheets("SubDataSheet").ActiveChart.ChartArea.Copy
Pres.Slides.Add Index:=Pres.Slides.Count + 1, Layout:=ppLayoutTitleOnly
Pres.Slides(Pres.Slides.Count).Shapes.PasteSpecial ppPasteEnhancedMetafile
Pres.Slides(Pres.Slides.Count).Shapes.Title.TextFrame.TextRange.Text = "Chart Title"
Pres.SaveAs _
Filename:="C:\OutPut_PPT.ppt", _
FileFormat:=ppSaveAsOpenXMLPresentation
Set Ppt = Nothing
Set Pres = Nothing
End Sub
我有一个 powerpoint presentation
和 diagrams
,其中图表的数据在 subdatasheet
中(双击图表时打开的那个)。
现在我想将 presentation
发送给客户,但不能更改 datasheet
中的数据,但可以 animations
。
所以只用 diagram
拍一张照片不是一种选择。
我试图删除 linkings
但没有成功。任何人都知道我如何在 vba
?
编辑:
根据 R3uK's answer
我试过:
Sub Export_to_Ppt()
Dim myChart As PowerPoint.Chart
Set myChart = ActivePresentation.Slides(1).Shapes("Diagramm 1").Chart
myChart.ChartArea.Copy
ActivePresentation.Slides(ActivePresentation.Slides.Count).Shapes.PasteSpecial ppPasteEnhancedMetafile
End Sub
这是有效的,但对我来说,我得到了一张无法动画化的图片。
我使用这个基础将我在 PPT 中的图表导出为 Office Graphs (ppPasteEnhancedMetafile
):
Sub Export_to_Ppt()
'
Dim Ppt As PowerPoint.Application, _
Pres As PowerPoint.Presentation
Set Ppt = CreateObject("PowerPoint.Application")
Set Pres = Ppt.Presentations.Open("C:\Template.potx")
Ppt.Visible = True
Sheets("SubDataSheet").ActiveChart.ChartArea.Copy
Pres.Slides.Add Index:=Pres.Slides.Count + 1, Layout:=ppLayoutTitleOnly
Pres.Slides(Pres.Slides.Count).Shapes.PasteSpecial ppPasteEnhancedMetafile
Pres.Slides(Pres.Slides.Count).Shapes.Title.TextFrame.TextRange.Text = "Chart Title"
Pres.SaveAs _
Filename:="C:\OutPut_PPT.ppt", _
FileFormat:=ppSaveAsOpenXMLPresentation
Set Ppt = Nothing
Set Pres = Nothing
End Sub