When developing Excel macros, you do not need to transfer code to a workbook. The Mathematica code can remain stored in a notebook file. In this case, any time you want to run a macro on a particular Excel workbook, open the notebook that contains the macro and, with the workbook open in Excel, evaluate the code from the notebook.