Discussion Board for collaboration related to QlikView App Development.
From API Guide>>>
sub ActiveOBJ
Set ContainerObj = ActiveDocument.GetSheetObject("CT01")
set ContProp=ContainerObj.GetProperties
ActiveObject=ContProp.SingleObjectActiveIndex
msgbox("Active Object=" & ActiveObject & " Id=" & ContProp.ContainedObjects.Item(ActiveObject).Id)
end sub
But this is giving error
Object doesn't support this property or method: 'ContProp.ContainedObjects.Item(...).Id'
Can anyone resolve it....
Hi Nitin,
I am not sure why it is not working, but the work around for this is
Create two variables
vIndex : 1
vCurrentContainerObject : =Pick(vIndex + 1, 'CH01', 'CH02') //CH01 and CH02 are objects in container
Macro:
Function Test
Set ContainerObj = ActiveDocument.GetSheetObject("CT01")
set ContProp=ContainerObj.GetProperties
set v = ActiveDocument.GetVariable("vIndex")
v.SetContent ContProp.SingleObjectActiveIndex ,true
end function
Hope this helps you.
Regards,
jagan.
Hi,
Please check below attached image for container macro.
Regards,
Its not helping............
Hi Nitin,
I am not sure why it is not working, but the work around for this is
Create two variables
vIndex : 1
vCurrentContainerObject : =Pick(vIndex + 1, 'CH01', 'CH02') //CH01 and CH02 are objects in container
Macro:
Function Test
Set ContainerObj = ActiveDocument.GetSheetObject("CT01")
set ContProp=ContainerObj.GetProperties
set v = ActiveDocument.GetVariable("vIndex")
v.SetContent ContProp.SingleObjectActiveIndex ,true
end function
Hope this helps you.
Regards,
jagan.
Try like:
sub GetActiveIndex
Set ContainerObj= ActiveDocument.GetSheetObject("CT01")
Set ContProp=ContainerObj.GetProperties
vActiveIndex="You clicked tab number: " & ContProp.SingleObjectActiveIndex
ActiveDocument.Variables("vActiveIndex").SetContent vActiveIndex, true
msgbox vActiveIndex
End Sub
By this how how I will get the activated object id(CHRT ID)
Hi,
The variable vCurrentContainerObject will have the chart ID. You need to assign the macro to a button when clicked on button you will get.
Regards,
Jagan.
But why the example in API guide is giving me error, Any IDEA???
Not Sure Nitin, may be Community Adminstrator Sara Leslie can help in this. Not sure whether it is a bug, let them confirm.
Regards,
Jagan.