VBA粘贴Excel活动工作表中每一嵌入式图表到一个新的PowerPoint幻灯片中

VBA粘贴Excel活动工作表中每一嵌入式图表到一个新的PowerPoint幻灯片中,第1张

概述VBA粘贴Excel活动工作表中每一嵌入式图表到一个新的PowerPoint幻灯片中

下面是内存溢出 jb51.cc 通过网络收集整理的代码片段。

内存溢出小编现在分享给大家,也给大家做个参考。

Sub Chartstopresentation()' Set a VBE reference to Microsoft PowerPoint Object libraryDim PPApp As PowerPoint.ApplicationDim PPPres As PowerPoint.PresentationDim PPSlIDe As PowerPoint.SlIDeDim Presentationfilename As VariantDim SlIDeCount As LongDim iCht As Integer' Reference existing instance of PowerPointSet PPApp = Getobject(,"Powerpoint.Application")' Reference active presentationSet PPPres = PPApp.ActivePresentationPPApp.ActiveWindow.VIEwType = ppVIEwSlIDeFor iCht = 1 To ActiveSheet.ChartObjects.Count    ' copy chart as a picture    ActiveSheet.ChartObjects(iCht).Chart.copyPicture _        Appearance:=xlScreen,Size:=xlScreen,Format:=xlPicture    ' Add a new slIDe and paste in the chart    SlIDeCount = PPPres.SlIDes.Count    Set PPSlIDe = PPPres.SlIDes.Add(SlIDeCount + 1,ppLayoutBlank)    PPApp.ActiveWindow.VIEw.GotoSlIDe PPSlIDe.SlIDeIndex    With PPSlIDe        ' paste and select the chart picture        .Shapes.Paste.Select        ' align the chart        PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,True        PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignmIDdles,True    End WithNext' Clean upSet PPSlIDe = nothingSet PPPres = nothingSet PPApp = nothingEnd Sub

以上是内存溢出(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

总结

以上是内存溢出为你收集整理的VBA粘贴Excel活动工作表中每一嵌入式图表到一个新的PowerPoint幻灯片中全部内容,希望文章能够帮你解决VBA粘贴Excel活动工作表中每一嵌入式图表到一个新的PowerPoint幻灯片中所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1275223.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-08
下一篇 2022-06-08

发表评论

登录后才能评论

评论列表(0条)

保存