Try that Hans W. Herber suggests:
Sub RemoveAllVBAElements()
'BY Hans W. Herber
Dim vbc As Object
Dim wks As Worksheet
Dim dlg As DialogSheet
With ActiveWorkbook.VBProject
For Each vbc In .VBComponents
Select Case vbc.Type
Case 1, 2, 3
.VBComponents.Remove vbc
Case 100
vbc.CodeModule.DeleteLines 1, vbc.CodeModule.CountOfLines
End Select
Next vbc
End With
'For old MACRO Excel4MacroSheets
Application.DisplayAlerts = False
For Each wks In Excel4MacroSheets
wks.Delete
Next
For Each dlg In DialogSheets
dlg.Delete
Next
Application.DisplayAlerts = True
MsgBox "All program-elements are deleted!", vbExclamation, "Hi, Ciao, Valete!"
End Sub