LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write Spreadsheet File.vi hidden file error 8

Solved!
Go to solution

I'm having an issue with the Write to Spreadsheet File.vi. I want to use a spreadsheet file to save temporary data to be accessed later when the program is closing. I write to a spreadsheet file while the program is running, open it and read from it when the program is complete and then write nothing to the file to clear all data in the file. The issue I'm having is during the final write; If the spreadsheet file is hidden (I would like it to be hidden so it is not deleted, removed or altered between program runs) the vi returns an error-

error 8 occurred at Open/Create/Replace File in Write Spreadsheet String.vi->Write To Spreadsheet File (DBL).vi

 

This error does not occur when writing actual data to the file only when I write a blank array to clear the file, and it only occurs when the spreadsheet file is hidden.

 

Attached is example of what is trying to be accomplished LV2012

0 Kudos
Message 1 of 9
(4,334 Views)

I think the problem is that you can't "replace" a hidden folder, which is what is happening when you try to write and set the Append to File to false.

 

Also, you really should not be saving these files with a XLS extension.  That function does not save in an Excel format.  You should instead use CSV 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 2 of 9
(4,313 Views)

So it is not possible to keep this file hidden? Is there a better way to store then clear this information?

0 Kudos
Message 3 of 9
(4,304 Views)
Solution
Accepted by LukeTEI

In theory you can use "Set Flie Size" to set the OEF to 0.  I've never tried on a hidden file.


"Should be" isn't "Is" -Jay
Message 4 of 9
(4,300 Views)

I just did a quick test and Jeff is right.  I was thinking about that when work interrupted my thought process.


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 5 of 9
(4,296 Views)

Instead of writing a blank array using Write to Spreadsheet File instead try using a zero passed to Set File Size.

Works for me when I tested it.

 

Drat!  Beaten to the punch 😃

0 Kudos
Message 6 of 9
(4,295 Views)

@JÞB wrote:

In theory you can use "Set Flie Size" to set the OEF to 0.  I've never tried on a hidden file.


Works great thanks for the help.

0 Kudos
Message 7 of 9
(4,291 Views)

HaH! snuck one past y'all


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 9
(4,287 Views)

you hid the folder which containing the spreadsheet file.But do not hide the spreadsheet file. It might work.

 

Smiley Tongue

 

0 Kudos
Message 9 of 9
(4,262 Views)