Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Export all sheets to ppt

Hi Community

I got the following macro but it will only export the active sheet and also the image got truncated.

sub exportppt

Set objPPT = CreateObject("PowerPoint.Application")

objPPT.Visible = True

Set objPresentation = objPPT.Presentations.Add

Set PPSlide = objPresentation.Slides.Add(1,11)

ActiveDocument.ActiveSheet.CopyBitmapToClipboard

PPSlide.Shapes.Paste

Set PPSlide = Nothing

Set PPPres = Nothing

Set PPApp = Nothing

End Sub

How can i export all the sheets in the application into different slides without the image being truncated?

20 Replies
Not applicable
Author

Hi SurynnChin,

Try this macro. It will create as much slides as sheets your document has including all the document elements.

sub ExportarPPT

  ActiveDocument.ActiveSheet.FitZoomToWindow

  ActiveDocument.ActiveSheet.ApplyZoomToAllSheets

  Set PPApp = CreateObject("PowerPoint.Application")

  PPApp.Visible = True

  Set PPres = PPApp.Presentations.Add

  PPSlideNo = 1

  For i = 0 to ActiveDocument.NoOfSheets - 1

  Set PPSlide = PPres.Slides.Add(PPSlideNo,1)

  ActiveDocument.GetApplication.WaitForIdle

  ActiveDocument.ActiveSheet.CopyBitmapToClipboard

  PPSlide.Shapes.Paste

  with PPSlide.Shapes(PPSlide.Shapes.Count)

  .left = 0

  .top = 20

  .width =720

  end with

  activedocument.nexttab

  PPSlideNo = PPSlideNo + 1

  NEXT

  PPres.SaveAs "C:\Presentation1.ppt"

  PPres.Close

  PPApp.Quit

  Set PPSlide = Nothing

  Set PPPres = Nothing

  Set PPApp = Nothing

End Sub