Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all...
I need to know the ID and/or the Caption of the active object in a container. I have tryed this API Guide 11 code:
Set ContainerObj = ActiveDocument.GetSheetObject("CT01")
set ContProp=ContainerObj.GetProperties
ActiveObject=ContProp.SingleObjectActiveIndex
msgbox("Active Object=" & ActiveObject)
Msgbox(" Id=" & ContProp.ContainedObjects.Item(ActiveObject).Id)
I can see the order of the active object (0,1,...), but "ContainedObjects.Item(ActiveObject).Id" is not working. Im using QV11.20 SR9.
I have seen some similar not answered posts with this question. It's a bug?
Thanks!
If you used names for your objects inside from the container then you get with the following code these label:
set CTObj = ActiveDocument.GetSheetObject("CT02")
set CTProp = CTObj.GetProperties
msgbox CTProp.ContainedObjects.Item(CTProp.SingleObjectActiveIndex).Text.v
If these name contained the object-id like "Bar-Chart Sales - CH01" you could read this per string-functions and used it for further purposes (not really nice but a workaround).
- Marcus
If you used names for your objects inside from the container then you get with the following code these label:
set CTObj = ActiveDocument.GetSheetObject("CT02")
set CTProp = CTObj.GetProperties
msgbox CTProp.ContainedObjects.Item(CTProp.SingleObjectActiveIndex).Text.v
If these name contained the object-id like "Bar-Chart Sales - CH01" you could read this per string-functions and used it for further purposes (not really nice but a workaround).
- Marcus
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