I want to create powerpoint presentation through VBA Code and I selected library (early binding) reference in tools also. But I'm unable to create Powerpoint application through VBA. I wrote the below code and i'm getting the error as "Class does not support automation or does not support expected interface" . Could you please help to resolve the issue.
Sub CreatePPT()
Dim MYPPT As PowerPoint.Application
Set MYPPT = New PowerPoint.Application
With MYPPT
.Visible = msoTrue
.Activate
End With
End Sub
You should add a Presentation :
Sub CreatePPT()
Dim MYPPT As PowerPoint.Application
Set MYPPT = New PowerPoint.Application
Dim PPTPresent as PowerPoint.Presentation
With MYPPT
.Visible = msoTrue
set PPTPresent = .Presentations.add
End With
End Sub
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.