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

How do I stop a macro that this loop?

Good morning everyone, I created a macro where it enters a loop (for) and I need this macro to be run when I click the button again how I do it?

1 Solution

Accepted Solutions
m_woolf
Master II
Master II

Do a Break (Ctrl + Pause)

View solution in original post

5 Replies
Not applicable
Author

I have this example of how to do macro loop to abort after the macro runs and there is some function that I can abort the macro. ??

set obj = ActiveDocument.GetSheetObject( "TX01" )
for RowIter = 0 to obj.GetRowCount-1
    for ColIter =0 to obj.GetColumnCount-1
        set cell = obj.GetCell(RowIter,ColIter)
        msgbox(cell.Text)
    next
next

m_woolf
Master II
Master II

Do a Break (Ctrl + Pause)

Not applicable
Author

Thanks it worked, would have as I put it on a button?

m_woolf
Master II
Master II

No

Use an Inputbox instead of a msgbox:

sub test
     for i = 1 to 100000
          Input = InputBox(i & " Type Q to quit")
          if Input = "q" or Input = "Q" then exit sub
     next
end sub

Not applicable
Author

thank you