Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
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
m_woolf
Master II
Master II

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

petter
Partner - Champion III
Partner - Champion III

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

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

Anonymous
Not applicable
Author

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

m_woolf
Master II
Master II

No, it won't.