Procedure too large

I wrote a macro that will open a sketch on a specific plane,then draw a spline. I want to do this many times. But solidworks iscrashing if I try to do more than 3 at sketches in a row, sayingthe Procedure is too large.
Each spline has about 125 points.

Does anyone know how to get around this?

Also I tried to attach the the file both as a swp and as a txt butI got an error message saying 'Sorry, the type of file you tried touplaid is not permitted.'
SolidworksApi macros