Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I implemented a macro button on dashboard to export all chart objects to powerpoint.
I want macro to go through all tabs and place all charts on ppt automatically after I click the button.
I have code written but it has image formatting issues that I can not place images neatly on ppt.
I tried to position images with function .left .top, etc. but it creates an error.
Does anyone know how to deal with it?
I attached an example to show what I am trying to do.
Thanks!
Ryan
Hi there
I had the same issue. In the end what i did was generate a macro which saves the charts tables, etc as jpg's. I have then dynically linked these in Powerpoint so that every time i run the export i can refresh back to the lates version of the images.
I hope this helps.
Michel
Hi Ryan,
replace your copy and paste instructions with the following set of instructions.
ActiveDocument.GetSheetObject("CH01").CopyBitmapToClipboard
PPSlide.Shapes.Paste
with PPSlide.Shapes(1)
.left = 10 'replace this value with your value
.top = 20 'replace this value with your value
end with
ActiveDocument.GetSheetObject("CH02").CopyBitmapToClipboard
PPSlide.Shapes.Paste
with PPSlide.Shapes(2)
.left = 50 'replace this value with your value
.top = 20 'replace this value with your value
end with
ActiveDocument.GetSheetObject("CH03").CopyBitmapToClipboard
PPSlide.Shapes.Paste
with PPSlide.Shapes(3)
.left = 80 'replace this value with your value
.top = 20 'replace this value with your value
end with
Best regards
Andrea
Thanks for sharing this. Is there a way each chart can be pasted in new slide?
Hi Digvijay,
yes, you have to add a new slide to the ppt with Set PPSlide = PPPres.Slides.Add(1, 1) instruction and then pate a chart in the new one slide with PPSlide.Shapes.Paste instruction.
Best regards
Andrea
Ok, got it. Thanks!