Yes, you can. The code is accessible in a collection, and you can certainly
change it.
However, can I suggest a possibly easier way ...
- Create a new workbook
- Copy the summary sheet to it
- Delete any other sheets in it (i.e. the default "Sheet1", "Sheet2", etc)
- Save and close this workbook as your summary.
This is all done in just a few lines of quite straightforward code. Manipulating
the vba code object is much less straightforward.
An alternative is to leave the code in the summary workbook, but have it check
for the absence of a key worksheet and just not do anything if the sheet isn't
there.