VBa access: check end of excel file when submitting reports

I am writing the results of some access table checks to an excel file. Sometimes the results exceed 65k, which is beyond the capabilities of Excel (excel 2002). How to check the end of the file and open a new sheet to continue

thank

0


source to share


2 answers


You have at least two options.

The first is simply counting the lines as they are printed (if writing does not occur immediately, save an additional file with the line count in the main file). When the number of lines approaches the limit (i.e. 65k), start a new sheet.



Depending on how flexible your file's structures are, an alternative is to write all the rows to an access table and then query the Excel sheet into an access table. This will result in a row limit in Excel 2002

+2


source


I have to ask how you output them to a file.



If it's procedural, then why not start a counter that goes up to 65535. When it exceeds that, start a new worksheet.

+1


source







All Articles