Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Rename a chart object using VBa

Hi .

I have this code to create a table:

set Graph = ActiveDocument.Sheets("Main").CreateStraightTable
id = Graph.GetObjectId
msgbox "Chart Name = " & id

, so I know the chart ID ( say "Document\CH07) , but I want to rename it to CH01. I suspect this my be through the getproperties, but assistance please!

1 Solution

Accepted Solutions
erich_shiino
Honored Contributor

Re: Rename a chart object using VBa

The macro is similar to this:

sub changeID

rem ** Change unique ID of a chart **

set g = ActiveDocument.GetSheetObject("CH01")

set gp = g.GetProperties

GP.GRAPHLAYOUT.Frame.ObjectId = "MyChart"

g.SetProperties gp

end sub

You can also check my attachment.

(After you click, the ID will change, the second time it will fail, ok?)

Regards,

Erich

3 Replies
erich_shiino
Honored Contributor

Re: Rename a chart object using VBa

The macro is similar to this:

sub changeID

rem ** Change unique ID of a chart **

set g = ActiveDocument.GetSheetObject("CH01")

set gp = g.GetProperties

GP.GRAPHLAYOUT.Frame.ObjectId = "MyChart"

g.SetProperties gp

end sub

You can also check my attachment.

(After you click, the ID will change, the second time it will fail, ok?)

Regards,

Erich

Not applicable

Re: Rename a chart object using VBa

Many thanks Eric, this is exactly what I needed!

Is there a reference document (or the api) avauilable where I can find details of the object properties? 

erich_shiino
Honored Contributor

Re: Rename a chart object using VBa

Yes, you can use the API Guide.qvw

It's located at:

C:\Program Files\QlikView\Documentation

You can also read the QV Automation reference.pdf.

There is a lot of examples in the .qvw

I think it`s not so clear how to follow it... for example, when i used:

.GRAPHLAYOUT

You get get more details by understanding the object iGraphLayout and so on...

Hope this helps,

Erich

Community Browser