View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Use CreateObject to add a new module to Excel

Alex,

Are you refering to a new VBA code module? If so, you don't use
CreateObject. Use code like the following:

ThisWorkbook.VBProject.VBComponents.Add ComponentType:=1


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"Alex" wrote in message
...
How can I use the CreateObject method to create a new module in an Excel
file?

thanks

Alex