Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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