Hi everyone,

I have been trying to export my recordset to excel and I keep getting a type mismatch error, but I am not sure why.

Here is my code...
VB Code:
  1. Dim oApp As Object
  2. Dim oWB As Object
  3.  
  4. Set oApp = CreateObject("Excel.application")
  5.  
  6.         oApp.Visible = True
  7.         Set oWB = oApp.workbooks.Add
  8.         oWB.sheets(1).Cells(1, 1).copyfromrecordset rsrpt

I have been searching for an answer on the forums here but havn't found one. Also it looks like a lot of the excel export code here keeps the spreadsheet closed and invisible after the export. This is not important to me since the user will likely work with the file some and save it on their own when they are done.

the error points to the .copyfromrecordset line and specificially says "runtime error 13 type mismatch" I get as far as an open instance of excel but no data inserted in it.

any help you can provide would be great!

Thanks

Oh BTW I am using an ADO connection to an access database and VB6