Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Not applicable

Macro creation of Objects

Hi,

Within a macro script I can retrieve objects and all kinds of information. The API Guide version 11 I can find Application Classes, Document Classes, Sheet Classes and all kinds of properties. With underneath statements I can simply find the Object typename from an object called Test1:

    set obj = ActiveDocument.GetSheetObject("Test1")

    msgbox Typename(obj)

I cannot find any example of a method to create an new How can I for instance create a new Tablebox object.

Does anyone has an example of how to create an empty Tablebox object?

With regards, Floris

1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Macro creation of Objects

Afaik it's not possible to create an empty table box. It will always need at least one field.

You can use the CreateTableBox method to create the table box:

set TB = ActiveDocument.Sheets("Test1").CreateTableBox

TB.AddField "MyField"


talk is cheap, supply exceeds demand
11 Replies
Chanty4u
Esteemed Contributor III

Re: Macro creation of Objects

did u chk dis?

Useful Qlikview Macros

Not applicable

Re: Macro creation of Objects

Thank Chanty for your reply.

Yes, I check those example macro scripts. I can only find Copy examples, but no creation of any objects.

MVP & Luminary
MVP & Luminary

Re: Macro creation of Objects

Afaik it's not possible to create an empty table box. It will always need at least one field.

You can use the CreateTableBox method to create the table box:

set TB = ActiveDocument.Sheets("Test1").CreateTableBox

TB.AddField "MyField"


talk is cheap, supply exceeds demand
MVP
MVP

Re: Macro creation of Objects

set TB = ActiveDocument.Sheets("Products").CreateTableBox

TB.AddField "ProductType"

TB.AddField "Product"

Re: Macro creation of Objects

There are quite a few Create... methods in the interface library. One for every Graph type for example.

In the API Guide, navigate to sheet "Automation Examples". In listbox Member, search for "Create*".

Best,

Peter

Not applicable

Re: Macro creation of Objects

Tnx Gijsbert, this is very usefull.

Not applicable

Re: Macro creation of Objects

Tnx Marco, I can use this.

Not applicable

Re: Macro creation of Objects

Peter,

I missed that sheet completely, tbnx for the information. Now I can create new objects from scratch.

Re: Macro creation of Objects

No problem, we're here to help and we're glad we could.

If you feel your question has been suitably answered, please mark one of the answers before mine as correct. If you feel other answers have been Helpful, please mark them as such. Thanks.

Peter