Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have a container which contains two tab for two charts. I want to know which tab is the currently active tab like GetActiveTabe(). I dont wanna change anything in the container just want to get the index.
Since there is no trigger, is there a walk around?
AFAIK - only with a VBScript Macro like this:
Sub GetActiveTab
Set ContainerObj = ActiveDocument.GetSheetObject("CT01")
Set ContProp=ContainerObj.GetProperties
ActiveObject=ContProp.SingleObjectActiveIndex
MsgBox ActiveObject
End Sub
BTW: Macros are considered "evil" ...
The alternative is to use separate charts instead of a container and show/hide these charts as needed based one or more variables that are controlled by button clicks or a selection in a listbox. You can find an example here: Toggling multiple charts with variables and conditional show
AFAIK - only with a VBScript Macro like this:
Sub GetActiveTab
Set ContainerObj = ActiveDocument.GetSheetObject("CT01")
Set ContProp=ContainerObj.GetProperties
ActiveObject=ContProp.SingleObjectActiveIndex
MsgBox ActiveObject
End Sub
BTW: Macros are considered "evil" ...
Why MsgBox? )
Thanks anyways
It should have been removed of course (the MsgBox) ... only tor testing ...
This was an issue that I brought up to R&D a while ago. Those who are using certain versions QlikView will notice that these properties no longer produce the desired result. The API for getting the active object and changing the active object programmatically can be found in this article with examples: https://support.qlik.com/articles/000070090