cancel exit SW

In the code below, I give the option not to exit the SW but it doesn't seem to work. Soon I hit "YES", SW is shutdown

Any help, please

Thank you

<p>Function DisconnectFromSW() As Boolean Implements SolidWorks.Interop.swpublished.SwAddin.DisconnectFromSW</p><p>        Dim msg = "Transfer Lincense ?"</p><p>        Dim response = MsgBox(msg, MsgBoxStyle.YesNo, "Tranfer Lincese")</p><p>        If response = MsgBoxResult.Yes Then</p><p>            MsgBox("don't want to exit SW")</p><p>            DisconnectFromSW = False</p><p>            Exit Function</p><p>        Else</p><p>            RemoveCommandMgr()</p><p>            RemovePMP()</p><p>            DetachEventHandlers()</p><p></p><p></p><p>            System.Runtime.InteropServices.Marshal.ReleaseComObject(iCmdMgr)</p><p>            iCmdMgr = Nothing</p><p>            System.Runtime.InteropServices.Marshal.ReleaseComObject(iSwApp)</p><p>            iSwApp = Nothing</p><p>            'The addin _must_ call GC.Collect() here in order to retrieve all managed code pointers </p><p>            GC.Collect()</p><p>            GC.WaitForPendingFinalizers()</p><p></p><p></p><p>            GC.Collect()</p><p>            GC.WaitForPendingFinalizers()</p><p></p><p></p><p>            DisconnectFromSW = True</p><p>        End If</p><p>    End Function</p>
SolidworksApi macros