You can open document invisible so you will have a pointer and can work with it (some of the APIs might be nonfunctional in this case). Check this method: 2012 SOLIDWORKS API Help - DocumentVisible Method (ISldWorks)
You can also lock your model for editing, so user is not able to do any changes while API should still work. Please check this thread: https://forum.solidworks.com/message/856078#comment-856078
I tried Imodeldoc2.Lock().
It works!. perfect!