Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Hi,
Check this URLs
http://community.qlik.com/message/56776#56776
http://community.qlik.com/message/194325#194325
Hope it helps you.
Regards,
Jagan.
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
Hi Pauldamen,
Can you share the code or the process that you are following for exporting QD sheet to PowerPoint. Thanks.
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.
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 ?
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 ?
I have tried above code but, I am getting error ,
ActiveX component can't create object: 'Powerpoint.Application'
Hi,
Do you Powerpoint installed in your machine??
Regards,
jagan.
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