我有一个带有PPT嵌入的Excel文档。
我想创建一个VBA子程序,将该文件复制到filepath
文件夹:
Dim PPTApp As PowerPoint.Application
Set PPTApp = New PowerPoint.Application
Dim Filepath As String
Filepath = ActiveWorkbook.Path
Dim File As PowerPoint.Presentation
' Worksheet(1).OLEObjects(1).Verb xlOpen
Set File = Worksheet(1).OLEObjects.Object
File.SaveAs Filepath & "\ppt.pptx", PowerPoint.ppSaveAsOpenXMLPresentation, msoTriStateMixed
如果我对该行留下评论,我会收到错误:
Run-time error 1004, Unable to get Object Property of OLEObject class
但如果我取消注释,PowerPoint将在保存文件之前启动。