I'm not sure if this applies to you but according to the SolidWorks API documentation, "If you are closing the only document in the SolidWorks session and the SolidWorks session is a background session, then calling ISldWorks::CloseDoc or this method results in the SolidWorks session closing."
Here are the recommended methods on the SW Documentation for opening and closing the application.
Hopefully one of those gets you fixed up.
Thanks, Alex. I used Visible and UserControl properties to keep SolidWorks open, and the error has disappeared.
ok.. so send the macro so we can test it.
"The object invoked has disconnected from its clients"
this means that the Runtime Callable wrapper has been destroyed and the object is no longer available through that reference.
The Remove server machine does not exist means i believe that an inprocess server is unavailable
so for some reason your Swapp object is being garbage collected
are you calling marshal.releasecomobject(Swapp) anywhere? because this will do that
if you are referencing SwModel after you call Swapp.Quitdoc then this will give you the same errors as if swapp was the culprit