I wonder if you could put a loop in the Main sub-routine that checks to see if the form is still visible and keeps looping until it is closed.
If you put DoEvents in the loop, SolidWorks will remain responsive. Something like:
You will pay with performance. At least combine it with sleep
#If VBA7 Then Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As LongPtr) 'For 64 Bit Systems #Else Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds as Long) 'For 32 Bit Systems #End If Sub SleepTest() MsgBox "Execution is started" Sleep 1000 'delay in milliseconds MsgBox "Execution Resumed" End Sub