drom
Well-known Member
- Joined
- Mar 20, 2005
- Messages
- 528
- Office Version
- 2021
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
Thanks in advance!
I already know this web:
http://www.cpearson.com/excel/vbe.aspx
I have checked the following reference whithin Excel VBA's references Manually:
Microsoft Visual Basic for Applications Extensibility 5.3
BUT when I run the following Macro, once checked the prior reference:
Why I get those errors.
What am I Missing??
I already know this web:
http://www.cpearson.com/excel/vbe.aspx
I have checked the following reference whithin Excel VBA's references Manually:
Microsoft Visual Basic for Applications Extensibility 5.3
BUT when I run the following Macro, once checked the prior reference:
Code:
Sub AddModuleToProject()
On Error Resume Next
Debug.Print Err ' I GET 0
Dim VBProj As VBIDE.VBProject: Set VBProj = ActiveWorkbook.VBProject
Debug.Print Err ' I GET 1004
Dim VBComp As VBIDE.VBComponent: Set VBComp = VBProj.VBComponents.Add(vbext_ct_StdModule)
Debug.Print Err ' I GET 91
VBComp.Name = "NewModule"
Debug.Print Err ' I GET 91
End Sub
Why I get those errors.
What am I Missing??