View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
kris kris is offline
external usenet poster
 
Posts: 128
Default How to add New Module through coding

I am trying the following but getting error messages, please help

Sub AddModule()
Dim VBComp As VBComponent
Set VBComp = ThisWorkbook.VBProject.VBComponents.Add(vbext_ct_S tdModule)
VBComp.Name = "NewModule"
Application.Visible = True
End Sub