Solution: Error 2306: There are too many rows to output (Access to Excel using OutputTo)

Solution: Error 2306: There are too many rows to output (Access to Excel using OutputTo)

Post by jshunte » Tue, 03 Jul 2007 13:25:00


I've joined the legions who've encountered this problem with the
OutputTo method in Access:

Run-time error 2306
There are too many rows to output, based on the limitation
specified by the output format or by Microsoft Access

A lot of people seem to have encountered it. The reason is because
OutputTo defaults to an old version of Excel which only allows 16K
rows

A lot of people also suggest using TransferSpreadsheet instead, but
that caused me a lot more problems (putting a single quote in front of
my text data)

Intellisense for the command does not list what your options are for
the FormatType, and the online Help doesn't mention it either, simply
giving "acFormatXLS" as the only Excel option

But there is a solution: use "acSpreadsheetTypeExcel9"

E.g. DoCmd.OutputTo acOutputQuery, "My Query",
acSpreadsheetTypeExcel9, "C:\Document\MyFile.xls", True

BTW I'm using Microsoft Access 2003 SP2

--John Hunter
 
 
 

Solution: Error 2306: There are too many rows to output (Access to Excel using OutputTo)

Post by Allen Brow » Wed, 04 Jul 2007 10:45:40

Thanks for posting the solution, John.

Hopefully this will help someone who is searching on this issue.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://www.yqcomputer.com/
Reply to group, rather than allenbrowne at mvps dot org.