Pagination in Excel 2003 when showing more than 65,536 rows

I have been busy these days in a very interesting concept. The system we are building is limited to Excel2003 only, and cannot be moved (yet) to Excel2007 or later.

That have been said, we have a lot of reports that pull data from Oracle database using SQL query that may (or may not) exceed the limitation in Excel2003 of 65,536 rows. So the approach followed was to add some piece of code that makes it fit.

In another word, what I did was adding code to allow Excel to list only the first 40,000 rows of that query instead of doing nothing. After that, that same code will show "Pagination" controls to allow user to jump to any page he likes.

This was part of it, the other part is allow that same code to pass on entire rows if it is not more than 40,000.
And as you might expected, that number (the 40,000 or Rows_Max) is a variable that can be changed by admin at any time using some hidden code.
And to make it more interesting, I added another variable (Called it Rows_Per_Page) to list only these number of rows per pages instead of the 40,000.

I liked that approach as I actually suggested that as part of my interview in this new job position in Chicago as "Excel Lead Developer"
work programming excel