Sub 删除所有模块的代码() Dim X With Application.VBE.ActiveVBProject i = 1 Do Until i > .VBComponents.Count X = .VBComponents.Item(i).Type Y = .VBComponents.Item(i).Name If .VBComponents.Item(i).Type <> vbext_ct_Document Then .VBComponents.Remove .VBComponents(Y) End If i = i + 1 Loop End With End Sub |