I can provide one solution to delete one module from Excel VBA Project
suppose that there are 2 module files : Module1 and Module2
I will write one function in Module1 to remove Module2
========================
Sub deleteModule2()
Set com = ThisWorkbook.VBProject.VBComponents.Item("Module2")
ThisWorkbook.VBProject.VBComponents.Remove (com)
End Sub
========================