我正在尝试创建一个VBA程序从excel的屏幕截图粘贴到PPT模板中。我已经在Windows上取得了成功,但我正在努力让它在MAC上工作。我知道让Office系列产品在Office for Mac上相互通信存在问题,但我希望一些旧的问题已经得到解决。关于这个主题的问题,在很大程度上是几年前的。
我可以使用下面的代码从目录中打开ppt模板,但只要我尝试选择特定的幻灯片,它就会崩溃。这是关于这个话题的最全面的对话,但它来自大约3年前。https://answers.microsoft.com/en-us/msoffice/forum/all/vba-copy-from-mac-excel-2016-and-paste-to/7d177c40-501b-471f-b4b4-81735652d492
我错过了什么愚蠢的东西吗?有解决办法吗?我的组织中一半人使用PC,另一半人使用Mac,所以仅仅使用Windows不是解决方案。
Sub CreateDealReviewPPT()
'Declare PPT Variables
Dim PPTApp As PowerPoint.Application
Dim PPTPres As PowerPoint.Presentation
Dim PPTSlide As PowerPoint.Slide
Dim PPTShape As PowerPoint.Shape
'Ranges for the directories
PPTTemplate = Sheets("Start Here - ISSP Instructions").Range("PPTTemplate").Value
Set PPTApp = CreateObject("PowerPoint.Application")
Set PPTPres = PPTApp.Presentations.Open(PPTTemplate)
PPTApp.Visible = True
PPTApp.Activate
PPTSlide = PPTPres.Slides(5)
PPTSlide.Select当我到达PPTSlide = PPTPres.Slides(5)时,它崩溃了。
我使用的是Mac OS Catalina。我在office365上使用的是Excel和PPT16.37版本。
发布于 2020-06-05 08:47:31
Office for Mac在CreateObject上有一个已知已久的缺陷。它就是不起作用。
此外,Office for Mac中的OLE实现仅限于PowerPoint。您可以从PowerPoint调用Excel和Word对象,但不能从Word或Excel调用PowerPoint。
最重要的是,2011年后的Windows对象模型充满了漏洞:在PowerPoint中工作得很好的命令和参数在Mac机上失败了。抱歉,这里一团糟。
https://stackoverflow.com/questions/62204810
复制相似问题