So können Sie Module, Klassenmodule oder UserForms erzeugen:
Sub Modul_anlegen()
Set VBP = Application.VBE.ActiveVBProject
VBP.VBComponents.Add vbext_ct_StdModule
VBP.VBComponents(VBP.VBComponents.Count).Name = "Modul"
End Sub
Sub Klassenmodul_anlegen()
Set VBP = Application.VBE.ActiveVBProject
VBP.VBComponents.Add vbext_ct_ClassModule
VBP.VBComponents(VBP.VBComponents.Count).Name = "Klassenmodul"
End Sub
Sub Userform_anlegen()
Set VBP = Application.VBE.ActiveVBProject
VBP.VBComponents.Add vbext_ct_MSForm
VBP.VBComponents(VBP.VBComponents.Count).Name = "UserForm"
End Sub
|