Error -2146827284 When Writing to Excel Report Using Report Generation Toolkit

Updated Jul 29, 2020

Reported In

Software

  • LabVIEW Report Generation Toolkit
  • LabVIEW

Issue Details

In my application, I write several rows and columns to an Excel worksheet created from a template. This works well for a certain amount of rows and columns, but I eventually get this error when I increase the number of rows to be written. What should I do?

Solution

Try writing fewer rows and/or columns with the application. Basically, reduce the amount of data that is being used until you don't get the error, or to a safe limit in which you are sure this does not happen. Then, you can use a while loop to write the data that has not been written with the previous iteration and so on.

Additional Information

Microsoft Excel spreadsheets were limited to 256 columns and 65,536 rows until its 2007 release which increased these limits to 16,384 columns and 1 million rows. If these limits are exceeded and there is an attempt to access a row or column outside the allowed range, this error will occur: Error -2146827284 from the Excel_Get_Range VI. Writing to an Excel spreadsheet inside a while loop can quickly exceed these limits if they are not checked. Report Generation Toolkit began supporting Office 2007 with version 1.1.2.

This issue can be related to memory usage, since testing in different LabVIEW and Excel versions give an error that mentions it is due to not enough memory for the operation.