Hi All,
I need to show some of the objects in one PPT slide using PPT macro. Am using below given Macro to get that. But, am getting desired object in 3 slides. How to get it done in one slide?
Sub ExportPPT
ActiveDocument.ActiveSheet.FitZoomToWindow
Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True
Set objPresentation = objPPT.Presentations.Add
For i = 0 To ActiveDocument.NoOfSheets - 1
' Set MySheet = ActiveDocument.GetSheet(i)
Set PPSlide = objPresentation.Slides.Add(1,1)
PPSlide.Shapes(1). Delete ' removes the title
PPSlide.Shapes(1).Delete ' removes the text box
' ActiveDocument.ActiveSheet.CopyBitmapToClipboard
ActiveDocument.GetSheetObject("CH17").CopyBitmapToClipboard
PPSlide.Shapes.Paste
with PPSlide.Shapes(PPSlide.Shapes.Count)
.left = 0
.top = 60
.width=200
.Height=200
end with
ActiveDocument.GetSheetObject("CH15").CopyBitmapToClipboard
PPSlide.Shapes.Paste
with PPSlide.Shapes(PPSlide.Shapes.Count)
.left = 380
.top = 60
.width=250
.Height=200
end with
ActiveDocument.GetSheetObject("CH12").CopyBitmapToClipboard
PPSlide.Shapes.Paste
with PPSlide.Shapes(PPSlide.Shapes.Count)
.left = 380
.top = 300
.width=250
.Height=200
end with
Next
objPresentation.SaveAs "E:\MyPresentation.ppt"
objPresentation.Close
objPPT.Quit
Set PPSlide = Nothing
Set PPPres = Nothing
End sub