I wanted to export around 300000 records that are present in my MS Access 2003 version table to excelsheet version8.
I had written a code to export to multiple sheets in one workbook, but i failed to export the continous records.
The code is exporting only the first 65536 records to multiple sheets.
I want to find a way for this.
--I tried to include an auto number field to my table but it was not successful.
--I tried to give range to export but it is not supported.
Code: ( text )
Expand|Select|Wrap|Line Numbers
- Option Compare Database
- Dim i As Long
- Dim ren, old As String
- Dim n As Integer
- Private Sub exportt_Click()
- n = 1
- i = DCount("*", "s_table")
- MsgBox i
- If i > 65535 Then
- ren = "s_table" & n
- DoCmd.Rename ren, acTable, "s_table_tayi"
- Else
- ren = "s_table"
- End If
- While i > 0
- DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, ren, "D:\export65k.xls", -1
- i = i - 65535
- old = ren
- n = n + 1
- ren = "s_table" & n
- DoCmd.Rename ren, acTable, old
- Wend
- End Sub
Aryan