trouble with C# macro in solidworks 2013

Hello,

I have trouble running a macro that worked fine in SW2010/11/12.

When i run it in sw2013 i get the following error:

"Object reference not set to an instance of an object."

Does anyone have an idea how to solve this?

SolidworksApi macros