>When I run the app, it works fine in calling up MS Excel 2000 and copying the recordset there. But when the machine only has MS Excel 97, the problem is encountered. Below is the code I use:
>
> Dim xlApp As Excel.Application
> Dim xlBook As Excel.Workbook
> Dim xlSheet As Excel.Worksheet
> Set xlApp = CreateObject("Excel.Application")
> Set xlBook = xlApp.Workbooks.Add
> Set xlSheet = xlBook.Worksheets(1)
Everything seems OK in declarations.
You said that the problem occurs when you are copying the recordset? How do you copy the recordset? If you use CopyFromRecordset, it will only works with Excel 97 if your recordset is DAO.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com