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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Changing a container caption via a macro

Hi,

Is it possible to change the title of a container object's caption via macro code? If so, what is the syntax?

The container object includes a pivot table with three tabs.

I have gotten as far as being able to identify the container object and access its properties:

set ct = ActiveDocument.GetSheetObject("CT02")

set c = ct.GetProperties

With this, I can see the container's current caption:

msgbox(ct.GetCaption.Name.v)

But I want to change the caption; there isn't something as obvious as 'SetCaption', so what is the syntax for changing the caption in (VBScript) macro code?

In case this has anything to do with versioning, I am using Qlikview v10 SR3.

Many thanks,

VB

2 Replies
Anonymous
Not applicable
Author

hi V B

     Hope the attached file will be helpful for you .

     We can change the caption using the variable and i attached the sample macro code file to you

     Using this you can simply change your container caption (using variable).

Regards

Ashok

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     There is no way to change the caption directly you have use it by using variable.

     Create a variable vVariable.Assign the initial caption value to it.

     Use this variable in caption as =vVariable

Then use macro below

sub containerCaption

set ct = ActiveDocument.GetSheetObject("CT02")

set c = ct.GetProperties

msgbox(ct.GetCaption.Name.v)

set v = ActiveDocument.Variables("vVariable")

v.SetContent "Sales",true

end sub

Hope it helps

Celambarasan