Click to See Complete Forum and Search --> : User-defined type not defined


regis
February 18th, 2000, 08:56 AM
I try to use an Excel app but each time I put
Dim xlApp As Excel.Application
I receive this error "user-defines type not defined" Why ?

this is my code

Public Sub ExportToExcel(Rs As Recordset, FileName As String)

Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
'Instantiate your Excel Objects

Set xlApp = New Excel.Application
Set xlBook = xlApp.Workbooks.Add()
Set xlSheet = xlBook.ActiveSheet
Dim iRow As Integer
Dim iCol As Integer



Thanks
Redg

Chris Eastwood
February 18th, 2000, 08:59 AM
Have you set a reference to Excel in the Project->References menu ?

Chris Eastwood

CodeGuru - the website for developers
http://codeguru.developer.com/vb