Archived:Error -2146827284 When Using New Report VI From LabVIEW Report Generation Toolkit

Updated Jun 20, 2023

NI does not actively maintain this document.

This content provides support for older products and technology, so you may notice outdated links or obsolete information about operating systems or other relevant products.

Reported In

Software

  • LabVIEW Report Generation Toolkit
  • LabVIEW

Issue Details

I am developing a LabVIEW VI using the Report Generation Toolkit for Microsoft Office. I am creating an Excel document using the New Report.vi and writing values to that report using the Excel Easy Text.vi.


When I run my program, my report is not written to and my error handler reports Error -2146827284 occurred at an unidentified location. What causes this error to occur and how do I prevent it from happening?

Solution

This error is being thrown by a specific invoke method within Excel Easy Text.vi. The following fixes will prevent this error from being thrown. 
  1. Change the minimized enum constant connected to the Create Report.vi to maximizedno change, or normal (One example can be seen in the snippet below.)
  2. Make sure you have the Microsoft Excel program fully opened before running your program.
 
KB_updated_VI.png
Solution Snippet ("minimized" enum changed to "maximized")
 Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram. 


If the above changes do not prevent this error from being thrown, check the following criteria:

  • The error occurs after a specific length of execution time
  • You are using Microsoft Excel 2003 or earlier

If your program meets these criteria, then this error is likely being thrown due to the pre-2007 Microsoft Excel spreadsheet size limit being reached.