Hello!
I was wondering if someone could tell me where im going wrong. Im trying to copy a recordset into an open excel sheet starting where the next empty cell in columnA is (the excel sheet was created in a previous macro, is still open and not saved, and does contain data). My code is the following but i get an error:
Dim objXL As Excel.Application
Set objXL = GetObject(, "Excel.Application")
Dim objWkb As Object
Set objWkb = Excel.ActiveWorkbook
With objWkb.ActiveSheet.Range("a1").End(xlDown).Offset(1, 0)
.CopyFromRecordset rs
End With
The error is: application-defined or object-defined error. Any ideas please?
I was wondering if someone could tell me where im going wrong. Im trying to copy a recordset into an open excel sheet starting where the next empty cell in columnA is (the excel sheet was created in a previous macro, is still open and not saved, and does contain data). My code is the following but i get an error:
Dim objXL As Excel.Application
Set objXL = GetObject(, "Excel.Application")
Dim objWkb As Object
Set objWkb = Excel.ActiveWorkbook
With objWkb.ActiveSheet.Range("a1").End(xlDown).Offset(1, 0)
.CopyFromRecordset rs
End With
The error is: application-defined or object-defined error. Any ideas please?