LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Corrupted Excel file?

Hi all,

I'm having problem with writing the data from my simulated vi data into Excel. After I run the Vi it works fine. But when I wish to open the excel file in which I set as the file path, it says the file extension is not valid. Why is that? Oh btw I'm still new so forgive me if this is an obvious question. I attached my VI as well as the error.

Regards,
Newbie92

Download All
0 Kudos
Message 1 of 11
(4,375 Views)

I forgot to mention that I intend to open the file after i stop the VI

0 Kudos
Message 2 of 11
(4,374 Views)
Do you know you CANNOT write an Excel XLSX file using WriteToSpreadsheetFile?
(Just a guess as I'm not able to look at your VI right now.)
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 11
(4,333 Views)

Best you can do is to write to a .csv file that excel can open an then save as excel workbook. Or try exporting to .xls instead of .xlsx.

In any way, i had the same problem like you and the .csv method workedd just fine for me, but feel free to try the last one too.

0 Kudos
Message 4 of 11
(4,309 Views)

Hi GerdW,

No I didn't know that. Thanks for the info. Actually my purpose is just to create a saving application and I thougt writing to Excel would be the best choice. Do you have any tips or guide that I could follow to do so?

Regards.
Newbie92

0 Kudos
Message 5 of 11
(4,304 Views)

Hi Lies,

I see. I will try and study the method. Thanks again.

 

Regards,

Newbie92

0 Kudos
Message 6 of 11
(4,300 Views)
Actually this is something that has changed around a bit over there life of Excel. At one point it wouldn't open tab-delimited files at all unless you explicitly told it that was what you were doing. Then there was a period where it would automatically open tab-delimited files if you gave them the XLS file extension. Now, it will still open files like that, but will generate the "warning" you saw first.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 7 of 11
(4,260 Views)

Hi mikeporter,

 

Thanks for the pointers. I'll keep that in mind when making my save applications.

Regards,

Newbie92

0 Kudos
Message 8 of 11
(4,226 Views)
If you want to save to a real excel file, there are ways of doing that too. Check the examples.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 9 of 11
(4,217 Views)

If you really want to write to Excel, you need the Report Generation Toolkit (which is now bundled with LabVIEW 2014).  If you type the word "Revised" (without the quotes) in the Search box of this forum, the first thing it pops up is an Example that I posted here showing how to do this.

 

Bob Schor

Message 10 of 11
(4,137 Views)