Connecting Tech Pros Worldwide Help | Site Map

Compile error: User-defined type not defined.

Newbie
 
Join Date: Oct 2007
Posts: 27
#1: Nov 6 '07
Hi everyone,
I am trying to export a table to an excel file using vba on a form's button click event. I am getting the error:

Compile error: User-defined type not defined.

And it highlights my first line:

Dim appExcel As Excel.Application

Any ideas? I am using Access 2003, but I am using Access 2000 file format. Does this have to with DAO and ADO something-or-others? I'm a beginner with all of this database stuff so please help!
Rabbit's Avatar
Expert
 
Join Date: Jan 2007
Location: California
Posts: 3,835
#2: Nov 6 '07

re: Compile error: User-defined type not defined.


You need a reference to the Microsoft Excel Object Library.
Newbie
 
Join Date: Oct 2007
Posts: 27
#3: Nov 7 '07

re: Compile error: User-defined type not defined.


Quote:

Originally Posted by Rabbit

You need a reference to the Microsoft Excel Object Library.

Perfect. Thanks Rabbit.
Rabbit's Avatar
Expert
 
Join Date: Jan 2007
Location: California
Posts: 3,835
#4: Nov 7 '07

re: Compile error: User-defined type not defined.


Not a problem, good luck.
Reply