The error occurs on the:

Set VBCodeMod = WB.VBProject.VBComponents(ModuleName).CodeModule

line of code in the Sub DeleteCodeLine