User-defined type not defined
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
Re: User-defined type not defined
Have you set a reference to Excel in the Project->References menu ?
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb