ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Use CreateObject to add a new module to Excel (https://www.excelbanter.com/excel-programming/378495-re-use-createobject-add-new-module-excel.html)

Chip Pearson

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





All times are GMT +1. The time now is 01:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com