Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
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
Gysbert_Wassenaar

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

View solution in original post

11 Replies
Chanty4u
MVP
MVP

did u chk dis?

Useful Qlikview Macros

Not applicable
Author

Thank Chanty for your reply.

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

Gysbert_Wassenaar

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
tresesco
MVP
MVP

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

TB.AddField "ProductType"

TB.AddField "Product"

Peter_Cammaert
Partner - Champion III
Partner - Champion III

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
Author

Tnx Gijsbert, this is very usefull.

Not applicable
Author

Tnx Marco, I can use this.

Not applicable
Author

Peter,

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

Peter_Cammaert
Partner - Champion III
Partner - Champion III

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