Hello,
I'm trying to paste some data from access into excel, but am currently only succeeding with the column headers.
My Copy and Paste Code is:
With objWorkbook.Worksheets("MonthlyView").range("A2")
For i = 0 To rs.Fields.Count - 1
.offset(-1, i) = rs.Fields(i).Name
Next
Set xlRng = objWorkbook.Worksheets("MonthlyView").range ("a2")
'copy in the data
xlRng.CopyFromRecordset rs
End With
Can someone please tell how to get the data in as well, plus help with why it is not currently working, then a star will surely be yours???
OOch
I'm trying to paste some data from access into excel, but am currently only succeeding with the column headers.
My Copy and Paste Code is:
With objWorkbook.Worksheets("MonthlyView").range("A2")
For i = 0 To rs.Fields.Count - 1
.offset(-1, i) = rs.Fields(i).Name
Next
Set xlRng = objWorkbook.Worksheets("MonthlyView").range ("a2")
'copy in the data
xlRng.CopyFromRecordset rs
End With
Can someone please tell how to get the data in as well, plus help with why it is not currently working, then a star will surely be yours???
OOch