11-14-2024 01:26 AM
Hello
I am using Excel report generation toolkit to create a template report. Its a DAY report, in which the a SINGLE ROW will be added to existing/new report after every test, i.e. ever time the subvi executes, a single row will be added to the excel file
My Issue
1. I am able to create the new excel file from the template and add the single line report, but whenever the vi executes, it throws an error while saving the excel file "Save report to File.vi"
2. I have tried to use clear error vi to remove this error. But some how after some while, the report stops generating and a *.tmp file starts getting created
3. I have attached some reports generated
To test my code, in the cluster, change the "DAY REPORT TEMPLATE FILE" . Select browse button on the Path Control and choose "DAY_REPORT_TEMPLATE.xlsx" file
I am using LabVIEW 2020 SP1 32 bit and
Microsoft® Excel® 2021 MSO (Version 2410 Build 16.0.18129.20100) 64-bit
Kindly provide help on this issue.
Solved! Go to Solution.
11-14-2024 01:28 AM
Sorry forgot to attach the project in earlier port
Project attached in this post
11-14-2024 08:52 AM
I can't open your file but I'm going to assume this is your problem because it is a common issue.
If you haven't added NI_Excel.lvclass to your project or you haven't used an Excel-specific VI, the VI needed to save an Excel file is not loaded, even though you specify Report Type as Excel.
No Excel-specific VI....
No Report to File for Excel.
Add Excel-specific VI....
Save Report to File for Excel is now available.
11-14-2024 11:40 AM
Hello
Thanks for the suggestion, but still the problem is not getting resolved
I have added "NI_Excel.lvclass" to my project and also the "Excel get activex reference vi" which you had suggested
The problem is that if I clear errors after excel File save, it sometimes works, but sometimes it creates a *.tmp files
The save excel throws error which is as follows
Exception occured in Microsoft Excel: Cannot access '14-11-2024.xlsx'.Help Path is xlmain11.chm and context 0 in NI_ReportGenerationToolkit.lvlib:Excel_Save_Workbook.vi->NI_Excel.lvclass:Save Report to File.vi->AUTO_UI_DAY_REPORT_TRIAL_SUBVI.vi
attached the project folder for the reference
11-14-2024 11:50 AM
Try the suggestions in this thread:
11-14-2024 11:10 PM
Hello
I had gone through that post before I posted here. Somehow that points highlighted in that post is not applicable in my case.
The only thought I am having and if someone can through insight is, that could the problem arise, if I am using the same excel file over and over again?
My use case is that, in my test bench, I am getting results after every periodic test complete cycle. In a day I might have several testing cycles of DUT in the production line.
So I want to save the data in formatted condition to a file. So when the test completed, I append the new data to the same excel file.
Could this be a problem?
I could solve this by creating a *.csv file, but since the formatting is not applicable in csv format, the report does not look appealing.
Thanks
11-15-2024 10:00 AM - edited 11-15-2024 10:03 AM
Hi I also just ran into this issue this week. Curious if your company's IT department just implemented a requirement to add a "sensitivity label", seen in the capture below, onto Microsoft Office files (Word, Excel, etc.). In my case, I cannot save a file unless I explicitely select an option from the dropdown. There is no default and LabVIEW does not support setting this with a built-in VI (that I am aware of). I am thinking this is the route of my issue, which is the exact same as the OP's.
11-16-2024 07:43 PM
Your mention of using .csv files (perhaps generated using "Write Delimited Spreadsheet" may explain why you are having problems and how you might be able to "have your .slxs and add to it, too".
First, notice that to develop an "incrementing Delimited Spreadsheet" file requires nothing more than (a) using basic LabVIEW File I/O (using strings) and (b) a quick-and-easy way to close a file, reopen it, and quickly reposition to the end-of-file in order to continue additional data.
Now bring the RGT and Excel into the picture. The RGT doesn't do the file I/O -- it instead passes data to Excel and instructs it how to format the data, then asks Excel to save the just-created file.
What you could do is to use the "Template" feature of the "Create Report" function. Here's how you might do this:
I haven't actually tried this, but it should work (Famous Last Words). Be sure to give Excel a "rest" between "Dispose Report" and the next "Create Report".
Bob Schor
11-19-2024 07:21 AM
Hello Bob,
Thanks for your suggestion
Since I am creating a new excel file everyday, in the <Reports\Excel\Day Report> folder i.e. copying a template file from <root> folder and pasting it in the Reports folder, the "Save Report to File.vi" was causing the error as the template file and the saved file were the same.
So right now, the following workaround worked for me.
I have disabled "Save Report to File.vi" and used only "Dispose Report.vi"
Therefore disabling the "Save Report to File.vi" which was creating an error is no longer required and the code works good as of now.
I think the second issue, i.e *.tmp file is probably because of long length i.e. filepath & filename put together, I will reduce the filepath on the clients side as well and check if it doesn't generate a *.tmp file.
Thanks all for your valuable suggestions.
11-19-2024 03:33 PM
hello! sorry it's not related to the topic but I've followed several of your posts.
I'm working in labview with an emg signal, and I want to decompose it into motor units (muaps). I don't know if I need filters or how I could. Can you give me an idea, please? Thank you very much!