06-11-2020 01:10 PM
06-11-2020 02:37 PM
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
06-12-2020 03:28 AM
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.
06-12-2020 07:47 AM
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.
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
06-12-2020 09:29 AM
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.