Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
for i=ubound(charts) to lbound(charts) step -1
you add the clause "step" at the end of your for statement:
FOR i=UBound(charts) TO LBound(charts) STEP -1
If i take step - 1 , wouldn't it miss the last object id in the extraction ?
No, it won't.