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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Container Caption text using macro

Hi,

I know the process of assigning caption text to container through macro is by creating a variable, assign the caption's text to this variable and then set variable value inside the macro, but this will only be applicable for existing container.

I have created my container through the macro, so I need to first assign the variable to the caption's text, but I don't know how to do this.

Any ideas?

Thanks,

Jyotsna

4 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this

Set ContainerObj = ActiveDocument.Sheets("Main").CreateContainer

set ContProp=ContainerObj.GetProperties

set v = ActiveDocument.Variables("vVariable")

v.SetContent "Sales",true

end sub

Reference:

Changing a container caption via a macro

Regards,

Jagan.

Not applicable
Author

This is ok but how will the container's caption link to variable.

Thanks,

Jyotsna

sujeetsingh
Master III
Master III

You need to call the variable in the caption i think.

Not applicable
Author

I need to do this from inside macro as the container is created using a macro.

Please let me know how to do this.

Thanks,

Jyotsna