View Full Version : Compile error


Danielf
03-27-2008, 02:33 AM
Hi,

I have the following code in an form:

Dim appExcel As Excel.Application

the purpose of the code is to open an excel file.

When I am running the form, I am receiving the following error:

" Compile error
user defined type not defined"

Where is my error?

Thanks for help.

Daniel

chergh
03-27-2008, 02:41 AM
Have you added a reference to excel object library?

Danielf
03-27-2008, 02:57 AM
Have you added a reference to excel object library?

No , I have no idea how to do this.

Daniel

chergh
03-27-2008, 03:12 AM
Go to the tools menu in the VB editor and select references. go through that list till you find the microsoft excel object library and check the box next to it.

Danielf
03-27-2008, 03:47 AM
Go to the tools menu in the VB editor and select references. go through that list till you find the microsoft excel object library and check the box next to it.

Hi Chergh,

Thanks a lot, it works

Have a nice day

Daniel