Compile Error on "dim x as VBComponent"?

  • Thread starter Thread starter PatFinegan
  • Start date Start date
P

PatFinegan

I get a Compile Error ("User-defined type not defined") whenever I
attempt to dim anything as "VBProject" or "VBComponent", even though
both objects are documented by Excel help. Am I missing something
simple?

I'm using Excel 2003, Office Pro Edition. Same problem on a different
PC running Excel 97.

Thanks in advance.
 
Pat,

You need to set a reference to the extensibility library. In the
VBA Editor, go to the Tools menu, choose References, and then
scroll down to and check "Microsoft Visual Basic For Applications
Extensibility Library".


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
I knew it had to be simple. Of course, I then discovered that I had to
change my security settings (Excel 2003 apparently differs from Excel
97 on "Trested Publishers").
 
Back
Top