Error -2146827284 When Trying to Save an Excel Report Using the Report Generation Toolkit

Updated Aug 2, 2019

Reported In

Software

  • LabVIEW Report Generation Toolkit

Issue Details

I have an Excel report already opened in my computer, if I try to create a new one and then save it with the same name of the one already opened using the Report Generation Toolkit code, I receive the error message of the next image:

 

Solution

This error message is originally generated by Excel, as this application will not allow you to save a new document with the same name of another one that is already opened. There can't be two Excel files with the same name in memory at the same time. You will receive the next message if your try to do this in the Excel application: 

 

As this is an error message originally defined by Excel, there is no available workaround apart of saving the document with a different name, as the error message of the application indicates.  

Additional Information

This same error may occur if, while using the Report Generation Toolkit code, you try to create and save two or more Excel documents with the same name but in different locations at the same time. This will happen because the Report Generation Toolkit will call Excel and open the program to create the first report so there will be a report already in memory and when the code tries to save the second one, it will have a conflict with the one already opened.