The only way that I know how to do this is to populate an array with the recordset and then set the worksheet = the array. I have used this and it works very well.
This is a lazy way of answering you question. I have just copied some code from a procedure of mine.Hope I understand what you want and hope this may help.
You will have to read through the other stuff which is not relevant to you.
---------
Dim objE As Object
Dim objW As Object
Dim blnR As Boolean
Dim Sfile As String
On Error Resume Next
ComFile1.ShowOpen
Sfile = ComFile1.FileName
If Sfile = Empty Then
Exit Sub
End If
Me.MousePointer = vbHourglass
Set objE = GetObject(, "Excel.application"
If Err.Number <> 0 Then
Set objE = CreateObject("Excel.application"
blnR = False
Else
blnR = True
End If
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.