05-28-2013 11:59 AM
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
Solved! Go to Solution.
05-28-2013 01:58 PM
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.
05-28-2013 02:30 PM
So it is not possible to keep this file hidden? Is there a better way to store then clear this information?
05-28-2013 02:51 PM
In theory you can use "Set Flie Size" to set the OEF to 0. I've never tried on a hidden file.
05-28-2013 02:58 PM
I just did a quick test and Jeff is right. I was thinking about that when work interrupted my thought process.
05-28-2013 03:06 PM - edited 05-28-2013 03:07 PM
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 😃
05-28-2013 03:08 PM
@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.
05-28-2013 03:14 PM
HaH! snuck one past y'all
05-29-2013 02:42 AM
you hid the folder which containing the spreadsheet file.But do not hide the spreadsheet file. It might work.