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

Updated Sep 21, 2021

National Instruments 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 New 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.
 
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. 

Additional Information

Note that New Report.vi was replaced with Create Report.vi in LabVIEW 2018.