No. However, when I deleted the "!" the trapclose worked both with a lable and with a sub
I suspect you might think it activated because the window itself was closed, but in reality, the window was just closed and the [quit] routine was not activated. If you place a "Wait" statement at the end of the [quit] routine instead of an "End" statement, you will see that when the structure of the TrapClose statement is not correct the [quit] routine is not actually activated on the window close event because it is just simply not set up.
Remove the exclamation mark prior to the TrapClose statement below and you will see that the [quit] routine does not activate when the window is closed, and the string "TrapClose [quit]" is simply printed to the #txtWin window. 'NoMainWin Open "My Text Window" For Text As #txtWin #txtWin "The fox jumped over the dog." #txtWin "!TrapClose [quit]"; Wait
[quit] Print "Trapclose was called!" Close #txtWin Wait