My code isn't working

  • Thread starter Thread starter eric
  • Start date Start date
E

eric

My VBA Code is not working. Everytime I run the code it
comes up with "User-defined type not defined". The code
is
Private Sub equipexport_Click()
Dim oXL As Excel.Application
Dim oWkb As Excel.Workbook
Dim oWks As Excel.Worksheet
Dim rstSubForm As DAO.Recordset
Dim iRow As Integer

and so on...

The second line is the highlighted line
(Dim oXL As Excel.Application).

I've used this before (on Office 2000, I now have XP) but
now it doesn't work. Thanks in advance for your help
eric
 
I'll ask the basic question then.
Have you set the references to Excel and DAO?

Regards

Peter Russell
 
Back
Top