Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro execution halts

Is there any thing wrong with below snippet? Macro execution halts highlighting the fourth line, but no error messages. Please help

sub removeUnusedSheets(retain)

cntsheets= ActiveDocument.NoofSheets

for sindx=cint(retain)+1 to cntsheets-1

    ActiveDocument.RemoveSheet sindx

    next

end sub

1 Reply
Anonymous
Not applicable
Author

It is possible that the sheet number doesn't exist or not properly created.  To find out, add line

msgbox(sindx)

in the loop before your fourth line.