LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 8, when writing to a file

Hello everyone. I just found that "Comments and Array to txt" VI in another forum, and i have problems to write in a excel file. When i run the VI, it gives me that error :

Text.png

 

How to handle that problem ?

 

Thanks in advance

 

Oesen

Best regards

Oesen
Message 1 of 11
(4,357 Views)

What is the value you set in the file path input? which file are you writing to?

 

Regards
Freelance_LV
TestAutomation Consultant
Message 2 of 11
(4,352 Views)

Hmm.. Value ?.. what do you exactly mean with that ?. I will write to Microsoft Excel

Best regards

Oesen
0 Kudos
Message 3 of 11
(4,350 Views)

in your vi, on the front panel, there is a file path input. what is the file path you have selected? you seem to be writing to the file inside program files folder. you might not have user rights to modify files inside that path.

 

try saving the file on the desktop and check if it saves correctly.

 

edit: also, if you want to write to a excel file, your  file name should have an extension '.xls'. however, in your error message, you seem to be writing data to a executable.

Regards
Freelance_LV
TestAutomation Consultant
Message 4 of 11
(4,347 Views)

Yep, the Error tells you the file name. You are trying to write to the actual Excel application executable. As suggested, change your filename and extension to an Excel document, e.g., .xls.

Message 5 of 11
(4,341 Views)

Thanks for the answers

 

I have copied a Excel document ("xlsx") to the desktop, and chosen this document in the file path. Now it only runs the VI 1/2 seconds and automatically stops the VI again. I can't open the Excel document after that procedure, is says that the file type or file format is invalid.

Best regards

Oesen
0 Kudos
Message 6 of 11
(4,326 Views)

try using the file extension .csv (can be created in excel by save as then select format as ms-dos comma seperated), xls (and xlsx) files have a load of header information you wont be using if you are handling the file with write to spreadsheet.

 

hope it helps

 

 

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
Message 7 of 11
(4,324 Views)

Thanks for the help

 

It works with a (.csv) file type, but the layout in the excel file is horrible.

 

I have connected my two column 2d array to "write to spreadsheet file", but it only write into one column in excel, and unfortunaly also rounds the numbers on. How do i change that ?. I want two decimal numbers.

 

 

 

 

 

 

Best regards

Oesen
0 Kudos
Message 8 of 11
(4,300 Views)

Untitled.png

Best regards

Oesen
Message 9 of 11
(4,299 Views)

It looks like there's a localized decimal point issue here.  What are you using for a delimiter?  I would use a tab and change the extension to txt.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 10 of 11
(4,294 Views)