Stretchwickster
Programmer
Hi People,
I've had to pick up a 4 year-old Excel worksheet that contains some VBA. I'm using Excel 2003. I've not had to touch VBA for a few years now, so I'm a bit rusty and consequently this question can probably be easily answered.
I have the following two lines in the top of a VBA module, both of which produce a "Compile error: User-defined type not defined".
From reading the help file on this error, it looks like Excel is not recognising the "CommandBar" and "CommandBarComboBox" data types. Presumably, I'm missing the reference that defines these types, so I've tried looking these up on MSDN to see if I could find what reference is required but I was getting a bit lost.
I currently have the following References checked:
- Visual Basic For Applications
- Microsoft Excel 11.0 Object Library
- OLE Automation
Any pointers would be greatly appreciated!
Clive
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
I've had to pick up a 4 year-old Excel worksheet that contains some VBA. I'm using Excel 2003. I've not had to touch VBA for a few years now, so I'm a bit rusty and consequently this question can probably be easily answered.
I have the following two lines in the top of a VBA module, both of which produce a "Compile error: User-defined type not defined".
Code:
Dim cBar As CommandBar
Dim SelectionBox As CommandBarComboBox
I currently have the following References checked:
- Visual Basic For Applications
- Microsoft Excel 11.0 Object Library
- OLE Automation
Any pointers would be greatly appreciated!
Clive

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096