我将PPT转换为PDF时出现错误,因为“ActiveX组件无法创建对象VBA”
Dim PPT As PowerPoint.Application
Dim newslide As PowerPoint.SlideRange
Dim slideCtr As Integer
Dim tb As PowerPoint.Shape
Set PPT = CreateObject("PowerPoint.Application")
PPT.Visible = True
PPT.Presentations.Open"C:\Users\GShaikh\Desktop\ProcessCoach certificate template.pptx"
Range("F8").Activate 'This cell had a date formatted as a date
slideCtr = 1
Set tb = PPT.ActivePresentation.Slides(slideCtr).Shapes("Text Box 4")
tb.TextFrame.TextRange.Characters.Text = Format(ActiveCell.Value, "m/d/yyyy")
'Error is here
ActivePresentation.ExportAsFixedFormat ActivePresentation.Path & _
"\" & ActivePresentation.Name & _
".pdf", ppFixedFormatTypePDF, ppFixedFormatIntentPrint