The Application.Quit seems to clear the variable. Move it to the ThisWorkbook module and use:
Public Sub DoQuit()
On Error GoTo Err1
' Unconditionally close Excel
ThisWorkbook.bRequestQuit = True
If Not ThisWB Is Nothing Then
ThisWB.Saved = True
End If
Application.Quit
Err1:
' display any errors
MsgBox Err.Description
End Sub
and you should probably do the same with the other variables.