Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Macro to export different objects from QlikView Sheets to power point

I am writing a macro in vbscript to export objects from sheets in Qlikview to a ppt. In a sheet, I have some objects in a sheet, but when I extract then to ppt, they are coming in reverse order of their id. Suppose the object ids a sheet are CH1, CH2, CH3.. In the code when I read them, they start from backward like CH3, CH2, CH1.. I have to place each object in specific position in ppt, so need to read them in correct order. I am using following code :-


set s=ActiveDocument.ActiveSheet
  charts
=s.GetSheetObjects

  
Set PPSlide = PPPres.Slides(pptiterno)
  
for i=lbound(charts) to ubound(charts)
  msgbox charts
(i).getobjectid


If in the sheet the objects are from CH57 - CH67, in the code they come as CH67-CH57. But I want them from CH57 - CH67. I simply tried to reverse the loop like :

for i=ubound(charts) to lbound(charts)

but this does not work. Can someone help me to reverse this object array ?

Thanks for any help

4 Replies
mwoolf
Honored Contributor II

Re: Macro to export different objects from QlikView Sheets to power point

for i=ubound(charts) to lbound(charts) step -1

MVP
MVP

Re: Macro to export different objects from QlikView Sheets to power point

you add the clause "step" at the end of your for statement:

FOR i=UBound(charts) TO LBound(charts) STEP -1

admin1
New Contributor III

Re: Macro to export different objects from QlikView Sheets to power point

If i take step - 1 , wouldn't it miss the last object id in the extraction ?

mwoolf
Honored Contributor II

Re: Macro to export different objects from QlikView Sheets to power point

No, it won't.

Community Browser