我是编码初学者,我正在尝试编写代码以将ppt文件保存为pdf。但是,我收到消息“运行时错误424”为必需对象”,该如何解决?
有我的代码:
Sub AbrirPP()
Dim ppPres As Object
Set ppPres = CreateObject("PowerPoint.Application")
With ppPres
.Visible = True
.Presentations.Open "C:\Users\Fede\Documents\Prueba.pptx"
.ActivePresentation.UpdateLinks
With ActivePresentation
.SaveCopyAs _
Filename:=.Path & "\" & ActivePresentation.Name & Format(Now, "yyyy-mm-dd") & ".pdf", _
FileFormat:=ppSaveAsPDF
End With
End With
Set ppPre = Nothing
End Sub