CommandBarControl works in one WB but not another

  • Thread starter Thread starter Dkline
  • Start date Start date
D

Dkline

I have a macro in a Workbook to add on a custom which starts off with:
Dim HelpMenu As CommandBarControl

I exported this module to a BAS file and imported it an identical workbook
save a name change of the workbook.

When I try and run this I get an error message:
Compiler Error:
User-defined type not defined

I didn't think CommandBarControl was a user-defined type.

I don't understand why it works first-time everytime in the "old" workbook
and fails in the "new" workbook.
 
Problem solved by John Walkenbach. I needed to turn on the Microsoft Office
Object Library.
 
Back
Top