LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel compatibility in LabVIEW report generation

Hello All, I am using LabVIEW 2018 and My excel template version is 2019. I can able to generate the report from my PC since I have an Excel version is 2019. If I am sharing the installer to other PCs that have 2013,2016 or any older excel versions, I could not generate the report due to the excel compatibility issues. I am getting the error "Error -2147352573 Member not found". My requirement here, is there any possible way to generate the excel report in other PCs that do not have the latest version of excel?
0 Kudos
Message 1 of 5
(3,328 Views)

Don't know, as you provided absolutely nothing for us to look at, to test, and to "try to fix".  Many of us have older versions of Excel, various versions of LabVIEW, and maybe enough "experience" (or "curiosity") to figure out how to make your unknown code work for you.

 

What do you think you should do to help us to help you?

 

Bob Schor

0 Kudos
Message 2 of 5
(3,296 Views)

Hi Bob Schor, 

Yesterday I could not able to attach VI due to some internet issues. 

Here I have attached my vi and error. Please download the vi for more information.

 

Thanks. 

 

Download All
0 Kudos
Message 3 of 5
(3,236 Views)

Thank you for attaching your code.  I think I can explain all of your problems without even trying to execute your code to "see for myself".

 

You report two types of failures.

 

  1. You use New Report to open the RGT and read an existing Excel file in as a Template.  You state that if you run this on a PC that has Excel 2016 installed, it works, but if you run it on a PC with only Excel 2013, it fails.  What I think is happening is that the Template file is written in Excel 2016 or higher, and that Excel 2013, by itself, cannot open it.  This is not LabVIEW's fault -- you asked LabVIEW to "ask Excel to open a file that it cannot open", and it returned an Error.
  2. You use New Report to open the RGT, read an existing Excel file in as a Template, use ActiveX to export it as a PDF, then open Acrobat.  You state that this works with Excel 2019, but fails to generate the PDF in Excel 2016.  Note, however, that it does not fail at the step of opening the 2016 Template, suggesting that my explanation for Failure 1 is correct.  This is a similar case of your asking LabVIEW to ask Excel (2016) something that it has not (yet) been programmed by Microsoft, namely to output directly to Acrobat, to do.  Again, this is not LabVIEW's fault.

Here is a suggestion -- try to write a little VI that can query Excel and determine its Version.  You already know that you need at least "Excel 2019" (I've not kept track of how Excel versions are named, but that's the name you used ...) to get the full functionality you need, so you can at least pop up a dialog box when your program starts to say something like "Sorry, this Program requires a current Version of Microsoft Excel in order to generate Reports".

 

Better yet, you can eliminate Error 2 by simply not saving the Report as a PDF, but saving it as Excel, and letting the User print (or otherwise output) it in whatever format she/he wants.

 

As for Error 1, I recommend that you "trap" the Error (use Clear Errors with that particular Error number as its "Error to Clear"), and if you see this Error, pop up a Dialog Box telling the User that he/she needs to open the Template file and save it, which (I hope) will save it in the existing Excel format.  Of course, if you provide an Excel 2016 Template, and the User cannot open it in Excel 2013, well, that's another problem.  Suggests that if you are providing the Templates, you take the responsibility for using the oldest Version of Excel that is reasonable (like 2013?) to avoid this problem.

 

Bob Schor

0 Kudos
Message 4 of 5
(3,221 Views)

Perhaps this could be due to Microsoft in 2016 adding a new, undocumented parameter called "WorkIdentity" to some of the Office ActiveX functions. If you have a newer version of Office installed on your LabVIEW PC then it'll use those newer functions. If I recall correctly, if you build an executable with it and then run it on another PC with an older version of Office, it'll fail due to the extra parameter. The opposite isn't an issue though, if you build on a PC with an older Office version and then run the .exe on a PC with a newer version, there's no error.

 

You can find a discussion about it here: https://forums.ni.com/t5/LabVIEW/Save-report-VI-from-report-generation-toolkit-is-broken/td-p/336224...

It's specifically about the "SaveAs" function appearing broken in LabVIEW because the parameter list provided with LV didn't match the one installed with Office.

 

0 Kudos
Message 5 of 5
(3,211 Views)