Upgraded from 2012 to 2016, need help with macro problem

Hey everyone! I finally upgraded my SolidWorks from 2012 to 2016, yay! Now, everytime I try to run a macro however, a SLDWORKS.exe starts up (I see it from the task manager) and the description says solidworks 2016. I already have solidworks 2012 running, and it seems to be colliding with it.

For now, I am still using 2012, because we have not upgraded software we use with the API to 2016 yet. So really my question is how do I specify which .exe to run when I want to run a macro?

Deepak, thanks for your reply. That did not fix my problem as there were no missing references. I'm not sure I explained myself well enough. I installed 2016, but I am still using 2012. When I run the macro on 2012, SLDWORKS.exe (2016) starts and my macro will not run.

I also tried Artem's suggestion with no success. This is a macro that was running fine in 2012. All I want is for 2012 and 2016 to be completely separated.

That macro is creating a new instance of SolidWorks, using the latest installed version. Since it opened a new session there is no model open, so swModel is empty/null which gives you that error. Check Task Manager and there is probably a session of 2016 running.

If you're running this within SolidWorks, then Deepak and Artem are correct and you should replace that line with their suggestion.

CreateObject("SldWorks.Application") creates a new session of SolidWorks, but it will be a background process unless you specify it as visible. That's why you have lingering 2016 version(s) still open.

This method is unnecessary if you are running the macro through an open session of SolidWorks.

NEVER MIND! It worked haha, I had a little directory issue... the macro I was editing was a copy of the macro I am using with a mouse shortcut. Therefore, when I was running the macro, it wasn't running the copy of the macro.