My Suggestion would be to export the database to a flat file (csv) using something like this below...
This is definitely faster than writing to Excel file directly...Code:Private Sub ExportToFile(rs As Recordset, FileName As String, Delimiter As String) If rs.EOF Then Exit Sub Dim fNum As Integer fNum = FreeFile Open App.Path & "\" & FileName For Output As fNum Print #fNum, rs.GetString(adClipString, , Delimiter, vbCrLf) Close #fNum End Sub
Once the .csv file is ready then count the number of lines and if it exceeds 65536 then simply split it![]()




Reply With Quote