Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I created a table with some random Dimension and Expression
Set Table = ActiveDocument.ActiveSheet.CreateStraightTable
Table.AddDimension ("Title"&Suffix)
Table.AddExpression ("[Current State"&Suffix&"]")
.
Now, when I want to use filters to order by some criteria, I want to rebuild everything the table like I did before, but with CreateStraightTable, it will generate again a new table and I want to drop the old table.
I thought about doing :
Set the_table = ActiveDocument.GetSheetObject("Table") // Where Table is the name from my current Sheet.
the_table.Cut
or:
the_table.Remove
or:
the_table.DeleteObject()
But none of those are working.
Could someone give me a hint?
Thanks
Hello,
Thanks for the quick reply.
It deletes all Objects from the Sheet.
But with a bit of adaptation I figured out the rest and this link:
http://community.qlik.com/thread/3177
'Delete Previous Chart
rem ** remove one sheet object on sheet Main **
set s=ActiveDocument.Sheets("Main")
orignumber=s.NoOfSheetObjects
for i=0 to orignumber-1
rem ** get unique object ID for given object on sheet **
set so = s.SheetObjects(i)
id = so.GetObjectId
'Prints all objects ids on the current sheet
'msgbox("ID = " & id)
'Prints Table ID
IF id = "Document\Table" THEN
'TableBox to be deleted
s.SheetObjects(i).Close
END IF
next
You need to use the close() member:
rem ** remove all sheet objects on sheet Main **
set s=ActiveDocument.Sheets("Main")
orignumber=s.NoOfSheetObjects
for i=0 to orignumber-1
s.SheetObjects(0).Close
next
Hello,
Thanks for the quick reply.
It deletes all Objects from the Sheet.
But with a bit of adaptation I figured out the rest and this link:
http://community.qlik.com/thread/3177
'Delete Previous Chart
rem ** remove one sheet object on sheet Main **
set s=ActiveDocument.Sheets("Main")
orignumber=s.NoOfSheetObjects
for i=0 to orignumber-1
rem ** get unique object ID for given object on sheet **
set so = s.SheetObjects(i)
id = so.GetObjectId
'Prints all objects ids on the current sheet
'msgbox("ID = " & id)
'Prints Table ID
IF id = "Document\Table" THEN
'TableBox to be deleted
s.SheetObjects(i).Close
END IF
next