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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
helen_pip
Creator III
Creator III

Macro to work on 2 container objects

Dear Qlikview user

I have copied a macro which changes the tabs on a container

I now have 2 containers with the exact same number of tabs, and wish for the macro to apply to both containers

Can anyone help me with how I can amend the macro code so that it incorporates the object "Container Graph" also

Sub ActivateTab(I)

  Set Obj=ActiveDocument.GetSheetObject("Container Table")

  Set ObjProp=Obj.GetProperties

  ObjProp.SingleObjectActiveIndex=I

  Obj.SetProperties ObjProp

end Sub

Sub ActivateTab0()

  ActivateTab(0)

end Sub 

Sub ActivateTab1()

  ActivateTab(1)

end Sub 

Sub ActivateTab2()

  ActivateTab(2)

end Sub

Sub ActivateTab3()

  ActivateTab(3)

end Sub

Sub ActivateTab4()

  ActivateTab(4)

end Sub

Sub ActivateTab5()

  ActivateTab(5)

end Sub 

Kind Regards

Helen

1 Solution

Accepted Solutions
marcus_sommer

Maybe with:

Sub ActivateTab(I)

for j = 1 to 2

  Set Obj=ActiveDocument.GetSheetObject("Container Table_" & j)

  Set ObjProp=Obj.GetProperties

  ObjProp.SingleObjectActiveIndex=I

  Obj.SetProperties ObjProp

next

end Sub

- Marcus

View solution in original post

2 Replies
marcus_sommer

Maybe with:

Sub ActivateTab(I)

for j = 1 to 2

  Set Obj=ActiveDocument.GetSheetObject("Container Table_" & j)

  Set ObjProp=Obj.GetProperties

  ObjProp.SingleObjectActiveIndex=I

  Obj.SetProperties ObjProp

next

end Sub

- Marcus

helen_pip
Creator III
Creator III
Author

Hello Marcus

Thank you very much

This works for me

Kind Regards

Helen