C# Standalone Question: Using Cosmos

Hi.  I am trying to make a standalone application using SolidWorks and Cosmos.  When I was only opening SolidWorks and modifying a part, this worked fine, but I can't find an example of how to use the simulation software without already having SolidWorks open.  My code is attached.  In my code, as in the example I was following, I attempt to get reference to Cosmos as an add-in, but this only works if SolidWorks is open and you have established Cosmos that way.  Is there a way to, say, open a study that you have already created?  Once I have that I can finish this just fine.

SolidworksApi macros