Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Export all sheets to ppt

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?

20 Replies
Siva_Sankar
Master II
Master II

Anonymous
Not applicable
Author

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

Anonymous
Not applicable
Author

Thanks Siva. But i read this 2 posts before their macro scripts didn't work for me.

sunilkumarqv
Specialist II
Specialist II

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

Anonymous
Not applicable
Author

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.

Anonymous
Not applicable
Author

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!

Anonymous
Not applicable
Author

Thanks for you explanation.

Is it possible to output the image after i fit zoom to window?

Anonymous
Not applicable
Author

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?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

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