Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

image formatting issue when using macro to export in ppt

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

5 Replies
Not applicable
Author

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

anlonghi2
Creator II
Creator II

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

Digvijay_Singh

Thanks for sharing this. Is there a way each chart can be pasted in new slide?

anlonghi2
Creator II
Creator II

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


Digvijay_Singh

Ok, got it. Thanks!