Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Macro Error: Export to PPT

I am not a Macro person but I have this simple macro to export a chart to PPT. However, when I call the macro, the macro editor appears. I think it means there is an error in the macro. Any suggestions to fix this issue

The command that appear to be in error are:

'objPresentation.SaveAs "Sample PPT.pptx"

'objPresentation.Close

'objPPT.Quit

Here is the sample macro.

sub test
'Create ppt object
Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True

Set objPresentation = objPPT.Presentations.Add
Set PPSlide = objPresentation.Slides.Add(1,11)
ActiveDocument.GetSheetObject("CH01").CopyBitmapToClipboard
PPSlide.Shapes.Paste
' Close Option 1
'objPresentation.SaveAs "Sample PPT.pptx"
'objPresentation.Close
'objPPT.Quit

' Close Option2
'PPPres.SaveAs "Frontline PPT.pptx"
'PPPres.Close
'PPApp.Quit
      
'Clean up
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing
end Sub

0 Replies