export a large file to excel

Swifey

Active Member
Joined
Jan 16, 2003
Messages
421
I currently use the subsequent code to export all our queries in an Excel format to a directory which works perfectly.
My problem is that this time my file contains 25404 rows and when I run my code I get a message “too many rows to output” – How can I get around this problem?


Code:
Option Compare Database

'------------------------------------------------------------
' Run Code
'
'------------------------------------------------------------
Function RunCode()
On Error GoTo RunCode_Err

    DoCmd.OutputTo acQuery, "Q6_Final Now SoldTo", "MicrosoftExcelBiff8(*.xls)", "\\cmq0134\\Customer Relationship Management\Prospects\Data\Upgraded.xls", False, "", 0
    
    '
RunCode_Exit:
    Exit Function

RunCode_Err:
    MsgBox Error$
    Resume RunCode_Exit

End Function

Many Thanks
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
My problem is that this time my file contains 25404 rows and when I run my code I get a message “too many rows to output” – How can I get around this problem?

What version of Excel do you have? AFAIK from at least XL97 on the limit of rows is 65536.

Why not try the TransferSpreadsheet method rather than OutputTo?
 
Upvote 0

Forum statistics

Threads
1,221,816
Messages
6,162,149
Members
451,746
Latest member
samwalrus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top