sorry for the ambiguity,
what I mean by that is:
If you were to put that code into a workbook and save it as an add-in. Then include that add-in to excel so that each time excel loads that code is available to your current project. Hence the code isn't being created each time excel loads, it is being "brought into" each project through the add-ins.

As I said, this code works perfectly except when being used as an add-in.

I hope that helps!