下面是内存溢出 jb51.cc 通过网络收集整理的代码片段。
内存溢出小编现在分享给大家,也给大家做个参考。
Sub RangetoPresentation()' Set a VBE reference to Microsoft PowerPoint Object libraryDim PPApp As PowerPoint.ApplicationDim PPPres As PowerPoint.PresentationDim PPSlIDe As PowerPoint.SlIDe' Make sure a range is selectedIf Not Typename(Selection) = "Range" Then MsgBox "Please select a worksheet range and try again.",vbExclamation,_ "No Range Selected"Else ' Reference existing instance of PowerPoint Set PPApp = Getobject(,"Powerpoint.Application") ' Reference active presentation Set PPPres = PPApp.ActivePresentation PPApp.ActiveWindow.VIEwType = ppVIEwSlIDe ' Reference active slIDe Set PPSlIDe = PPPres.SlIDes(PPApp.ActiveWindow.Selection.SlIDeRange.SlIDeIndex) ' copy the range as a piicture Selection.copyPicture Appearance:=xlScreen,_ Format:=xlPicture ' Paste the range PPSlIDe.Shapes.Paste.Select ' Align the pasted range PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters,True PPApp.ActiveWindow.Selection.ShapeRange.Align msoAlignmIDdles,True ' Clean up Set PPSlIDe = nothing Set PPPres = nothing Set PPApp = nothingEnd IfEnd Sub
以上是内存溢出(jb51.cc)为你收集整理的全部代码内容,希望文章能够帮你解决所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
总结以上是内存溢出为你收集整理的VBA粘贴Excel选定工作表范围到活动的PowerPoint幻灯片中全部内容,希望文章能够帮你解决VBA粘贴Excel选定工作表范围到活动的PowerPoint幻灯片中所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)