Serious error attempting to run macro.

Does anyone know why a macro would run perfectly fine on some workstations but then error on others?

Please note that the macro did run on one particular machine but for some reason it stopped working and now displays the same error.

The error is shown in the attachment, is is as follows:

      "A serious error occurred during macro playback.

     Perhaps the macro was not played in the correct context.

     The system could be in an unstable state now."

The macro creates a part so no other documents need be open.

In my case, I can also run the macro while in Part, Assembly or Drawing mode and it works fine.

SolidworksApi macros