Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Remove sheet object VBScript

How to remove/delete a sheet object with given name in VBscript ?

I would like to loop over all sheet objects, find its name, and delete it if the name equals some given value ,.

2 Replies
robert_mika
Master III
Master III

Old topic but if someone are looking for a similar solution....

This macro will remove object based on user input

Sub DeleteObject

set s=ActiveDocument.Sheets("Main")

name = ActiveDocument.GetApplication.InputBox("Enter name of the object?")

Objects = ActiveDocument.ActiveSheet.GetSheetObjects

    For j = lBound(Objects) To uBound(Objects)

        set obj = Objects(j)

IF obj.GetCaption.Name.v = name Then

s.SheetObjects(j).Close

else

end if

next

End Sub

Not applicable
Author

Hi Robert

Thank you very much!

It will help me a lot !

Regards