Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
thankuever
Contributor II
Contributor II

export ppt by the selection of condition.

HI ALL,

I want to export objects to .pptx.

The results  are build on the selection of listbox or any graph.

For example:

  ActiveDocument.Fields("Year").Select("2013")
  ActiveDocument.Fields("Quarter").Select("Q3")


output the result satisfied the condition "2013" and "Q3".

The result may be any graph such as Gauge that display  the gross profit in 2013 Q3.

how can i do?


Thanks.


Amy


1 Reply
Frank_Hartmann
Master II
Master II

Hi,

just add two QV Variables (Settings-->Variable Overview-->Add)

vTest1=GetFieldSelections(Year)

vTest2=GetFieldSelections(Quarter)

then add following code to module and adjust path of export and ObjectID of your Chart:

Sub Exportppt

    SET Doc = ActiveDocument

    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

 

    set v=ActiveDocument.Variables("vTest1")

    getVariable1 = v.GetContent.String

    set w=ActiveDocument.Variables("vTest2")

    getVariable2 = w.GetContent.String

     

    ActiveDocument.Fields("Year").select getVariable1

    ActiveDocument.Fields("Quarter").select getVariable2         

    ActiveDocument.GetSheetObject("CH01").CopyBitmapToClipboard  ' Please adjust the ObjectID

    ActiveDocument.GetApplication.WaitForIdle

    with PPSlide.Shapes.PasteSpecial(1)        

    end with 

     

filePath = "C:\Users\Admin\Desktop\Export.pptx"        'Please adjust according to your local environment

PPApp.ActivePresentation.SaveAs filePath   

end sub

and finally take care that you setup security correctly

Unbenannt.png

hope this helps