Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pauldamen
Partner - Creator II
Partner - Creator II

Exporting to ppt

Dear all,

I am looking for a macro to export objects to ppt.

What I need is to be able to select different objects accross different slides and copy them to fixed positions in an existing ppt. So for example object CH01 needs to be intergrated in slide 4 of an existing ppt.

Can some one help me with this macro, I did found general macro's to copy whole sheets but not as specific as I need it.

Regards,

Paul

11 Replies
jagan
Luminary Alumni
Luminary Alumni

pauldamen
Partner - Creator II
Partner - Creator II
Author

Thanks for the reply

I found those links as well but I just can't get them to work for me. Copying whole sheets is no problem but I need to be able to copy specific images.

I attached a dressed down version of my application, hope you can help me.

Regards,

Paul

Not applicable

Hi Pauldamen,

Can you share the code or the process that you are following for exporting QD sheet to PowerPoint. Thanks.

Not applicable

Try this macro

Sub Export2PPT_IndividualCharts

Set PPApp = CreateObject("Powerpoint.Application")

PPApp.Visible = True ' Create a presentation

Set PPPres = PPApp.Presentations.Add

Set PPSlide = PPPres.Slides.Add(1, 1)

PPSlide.Shapes(1).Delete ' removes the title

PPSlide.Shapes(1).Delete ' removes the text box

ActiveDocument.GetSheetObject("CH198").CopyBitmapToClipboard

ActiveDocument.GetApplication.WaitForIdle

  with PPSlide.Shapes.Paste

      .Left  = 150

      .Top  = 50

      .Width = 150

      .Height = 450

     end with

PPPres.SaveAs "C:\Individual.ppt" 'comment this if you dont want ppt to close automatically

PPPres.Close          'comment this if you dont want ppt to close automatically

PPApp.Quit      'comment this if you dont want ppt to close automatically

Set PPSlide = Nothing

Set PPPres = Nothing

Set PPApp = Nothing

End Sub

You may have to change the values .Left, .Top, .Width, .Height. I tried the above values then check in ppt and alter the values again.

vinicius_siquei
Partner - Contributor III
Partner - Contributor III

Guys I´m trying to use this script, however I´m getting expected object error message for the lines:

      .Left  = 150

      .Top  = 50

      .Width = 150

      .Height = 450

Any idea of how to solve that ?

Not applicable

Sorry for the late reply.

I think the actual error is coming from this line:
"with PPSlide.Shapes.Paste"
because .Left ... .Top has got nothing in it to throw an error... Its just setting the co-ordinates.

Anyways, did u manage to solve it ?

vijetas42
Specialist
Specialist

I have tried above code but, I am getting error ,

 

ActiveX component can't create object: 'Powerpoint.Application'

jagan
Luminary Alumni
Luminary Alumni

Hi,

Do you Powerpoint installed in your machine??

Regards,

jagan.

Not applicable

Hi Jagan,

     The linkages are longer valid. Do you know other link(s) i can learn about Exporting to PPT.

Thank you very much!

Zhou