What is the maximum number of rows that can be output to Excel from Access when using the DoCmd.OutputTo command with an Access report ?

Posted on 2006-06-16
Last Modified: 2008-01-09
What is the maximum number of rows that can be output to Excel from Access when using the DoCmd.OutputTo command with an Access report ?
I am using Access as the front end and SQL server as the back end database.

DoCmd.OutputTo acOutputReport, "rptDtlBranchAll", acFormatXLS, ExportedFile
Question by:zimmer9
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 34

Expert Comment

ID: 16920710
about 65000 or so
LVL 43

Expert Comment

ID: 16920752
Hi zimmer9,

Depending on the version of excel it varies, though 65536 is the max number of rows that the later versions can manage.

Tim Cottee

Author Comment

ID: 16920946
If I am using Microsoft Excel 2003 and in the references, I have Microsoft Excel 11.0 Object Library, then how many rows do you think the max would be ?

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

LVL 44

Expert Comment

ID: 16921011
You can export 65536 records per worksheet in a workbook.  However, in a workbook you can have up to 255 pages I believe, so with careful manipulation of your export, you can cram a lot of data into a workbook.

Author Comment

ID: 16921888
Is there a limit as to how many report pages can be exported perhaps due to page breaks ?

When I run the report from the Access Reports object, it totals 800 pages.

When the following line executes:

DoCmd.OutputTo acOutputReport, "rptDtlBranchA", acFormatXLS, ExportedFile

I get a run time error 2306
There are too many rows to output based on the limitation specified by the output format or by Microsoft Access.
LVL 44

Accepted Solution

GRayL earned 500 total points
ID: 16923482
VB Editor (Ctl-G) click Help, Answer Wizard, type Specifications, and click on - Read about form and report specifications.  Does that answer you question?  I'm running A2K and according to the Specification, I can run a report with 65535 pages.
LVL 26

Expert Comment

ID: 16929330
For info - Office 12 Excel (should be out in October) can handle 1 million rows (about time!)

Also, if you need to export more than 65535 rows, you can loop through teh data and put the first 65k on one worksheet, then move to next worksheet etc...

LVL 44

Expert Comment

ID: 16930073
Danny: I believe I said that in my post http:Q_21889007.html#16921011.

LVL 44

Expert Comment

ID: 16962834
Thanks, glad I could help.

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question