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: 
Not applicable

Passing GetSheetObject Dynamically!

Hi All

In the below macro script instead of passing the GetSheetObject manually(CH05) how can I pass the GetSheetObject dynamically? Please help me out! It is little urgent

set chart=ActiveDocument.GetSheetObject("CH05")

Thanks

Attitude

4 Replies
IAMDV
Luminary Alumni
Luminary Alumni

Hi,

Please look at this thread. If you still need help then please paste full code with explanation.

Cheers - DV

Not applicable
Author

Hi All

In the below macro code can anyone help me out to pass GetSheetObject dynamically instead of hardcoding it("CH06"). This is really urgent! Hope some one can help me out on this.

set chart=ActiveDocument.GetSheetObject("CH06")

set Prop = chart.GetProperties

set vars = Prop.Dimensions

for i = 0 to vars.Count-1

    vars.Item(i).SortCriteria.SortByAscii = 0

    vars.Item(i).SortCriteria.SortByLoadOrder = 1

next

chart.SetProperties Prop


Thanks

Attitude

perumal_41
Partner - Specialist II
Partner - Specialist II

Hi ,

Try this macro .

MyCharts=MySheet.GetSheetObjects

            For X =lbound(MyCharts) to ubound(MyCharts)

                    ActiveDocument.Sheets(i).Activate

                    msgbox("Chart: " & MyCharts(X).GetObjectId)

set chart=ActiveDocument.GetSheetObject(MyCharts(X).GetObjectId)
set Prop = chart.GetProperties
set vars = Prop.Dimensions
for i = 0 to vars.Count-1
    vars.Item(i).SortCriteria.SortByAscii = 0
    vars.Item(i).SortCriteria.SortByLoadOrder = 1
next

next
chart.SetProperties Prop

IAMDV
Luminary Alumni
Luminary Alumni

Attitude - The above code snippet by Perumal A is same as what I have written sometime back. This is the post where I have given detailed explanation on looping through the chart objects.

Cheers - DV