Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Community
I got the following macro but it will only export the active sheet and also the image got truncated.
sub exportppt
Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True
Set objPresentation = objPPT.Presentations.Add
Set PPSlide = objPresentation.Slides.Add(1,11)
ActiveDocument.ActiveSheet.CopyBitmapToClipboard
PPSlide.Shapes.Paste
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing
End Sub
How can i export all the sheets in the application into different slides without the image being truncated?
Look at this discussion http://community.qlik.com/message/240022#240022 and http://community.qlik.com/message/196413#196413
Regards.
Siva
Try this.....
sub exportppt
Set objPPT = CreateObject("PowerPoint.Application")
objPPT.Visible = True
Set objPresentation = objPPT.Presentations.Add
PPSlideNo = 1
For i = 0 to activedocument.noofsheets -1
Set PPSlide = objPresentation.Slides.Add(PPSlideNo,12)
ActiveDocument.GetApplication.WaitForIdle
ActiveDocument.ActiveSheet.CopyBitmapToClipboard
PPSlide.Shapes.Paste
Set PPSlide = Nothing
Set PPPres = Nothing
Set PPApp = Nothing
activedocument.nexttab
PPSlideNo = PPSlideNo + 1
NEXT
End Sub
Thanks Siva. But i read this 2 posts before their macro scripts didn't work for me.
Hi SurynnChin
Your are actually on the way use for conditions for no of sheets
For i = 0 To ActiveDocument.NoOfSheets - 1
' Set MySheet = ActiveDocument.GetSheet(i)
Hope it helps
The macro did allow me to copy the image for all sheets in the qv to a ppt slide but however the images got truncated. Any idea for this? Attached a sample app with your macro QlikView demo: Credit Risk Management and the export ppt.
At first it did not make sense that the images were truncated, but after running it on my side and comparing results with your pptx I know what the issue is.
The images are actually not truncated. Rather, the image is only what was visible/in view for the qvw app when the macro executes. So, for example, resize the qlikview window to really small and then execute macro (output images are really small). Then resize window to as big as you can make it on the monitor and execute macro (output images as big as you could make it on your monitor).
This proved challenging to explain. Let me know if this doesn't make sense and I'll attempt to illustrate again. Hope that helps!
Thanks for you explanation.
Is it possible to output the image after i fit zoom to window?
I'm sorry....I don't understand your question.
Are you saying - is it possible to fit the zoom to window (using macro) and then export image to ppt?
Add the following four statements to your macro, immediately after the SUB header:
ActiveDocument.ActiveSheet.FitZoomToWindow
ActiveDocument.GetApplication.WaitForIdle
ActiveDocument.GetApplication.Refresh
ActiveDocument.ActiveSheet.ApplyZoomToAllSheets