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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Macro to add a chart in a container

Hi,

I would like to know if there is a way to add a chart to a container....

I know how to select the container with my macro but I don't know if there is a function which can do what I want.

Thank you

Thomas

1 Reply
Anonymous
Not applicable
Author

My question has changed a little...

I can add an element to a container with this code:

Set ContainerObj =ActiveDocument.GetSheetObject("CT01")

set ContProp=ContainerObj.GetProperties

ContProp.ContainedObjects.Add

ContProp.ContainedObjects.Item(0).Def.ObjectId = "Document\CHBI"

ContProp.ContainedObjects.Item(0).Text.v = "Test"

ContainerObj.SetProperties ContProp

But like this, I always paste the chart to the first position on my container et so I can't add, each time I use my macro.

In fact, I would like to add a chart to the container each time I clik on a button.

So I have to find the way to count how many chart are already in the container to add one.