I\'m trying to use Chip Pearson\'s code for overwriting an existing VBA code module with an import from another project. Original code here.
The particular section
I tried the renaming and found that it caused problems with the sheet modules and ThisWorkbook. So I modified it slightly to rename only the non document modules. This seems to work cleanly.
If .Item(ModuleName).Type <> vbext_ct_Document Then
.Item(ModuleName).Name = ModuleName & "_OLD"
.Remove .Item(ModuleName & "_OLD")
Else
.Remove .Item(ModuleName)
End If