toggle macro?

Perhaps an easy one you guys. I'm trying to overcome a issue in Solidworks with the stupid "auto solve mode" always switching on me. Since I can't figure out why it keeps happening I figured I'd create a macro to toggle the on/off of this command. However, I'm not savvy with code language. I got it to turn on if it were off and off if it were on with TRUE and FALSE, but I don't know how to make it toggle. This is my code:

Dim swApp As Object

Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long

__________________________________________________

Sub main()

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc
Part.SketchManager.AutoSolve = True

End Sub

Any suggestions?

SolidworksApi macros