SW-2012 Macro Error,working perfect on SW-2011

I am getting the following error while running a macro on SW-2012 SP1

But the same macro runs perfect on SW-2011 SP4

I tried adding reference before running on 2012, gives same issue

Any suggestions

Thanks in advance

SolidworksApi macros