Hi guys,

I've been scanning through a few previous threads on accessing and manipulating Excel documents via VBA. I've found a lot of useful information (thanks, btw!) but I've come up against a problem that doesn't seem to be dealt with by anything previously.

I'd be delighted if anyone here could help. My problem involves opening an Excel document. This is the code I'm currently using -

Code:
Public Sub ReadExternal()

Dim appExcel As Excel.Application
Dim appBook As Excel.Workbook
Dim appSheet As Excel.Worksheet

End Sub
Whenever I try to call that method (from a button on a form) I receive the following message -

Compile Error - User-defined type not defined.
The compiler seems to take exception to the "Dim appExcel As Excel.Application" line.

Any advice would be most welcome.

Thanks.