05-22-2006 08:43 AM
05-22-2006 12:51 PM
You are improperly using the Open/Create/Replace VI. This is perfect when you use this reference for writing data to the file in LV. By specifying Read/Write this VI is locking access to the file until the reference is automatically disposed of.
Use the File Dialog VI instead. It returns the full path to the selected file without opening it. Check the canceled output to see if the user did not select a file.
The number of sheets in a new workbook is set by the Excel configuration. Go to Tools->Options->General and you will see the setting. If you will be running on another computer later then use Sheets.Count to determine how many there are in the new workbook and Sheets.Add to add the second sheet.
05-22-2006 05:23 PM
05-23-2006 02:30 PM
Sounds like you are writing an empty file to trick Excel when the user wants to create a new file. When you open this in Excel it will be parsed as a Text file. That is why you only have one sheet.
I recommend that you check for the File Info of the specified file and use a case statement to select between Workbooks.Open and Workbooks.Add. You can also use the Error Out of the Open to insert the Add into the sequence. After the Workbook is added you can SaveAs to create a valid Excel workbook file.
05-01-2010 06:15 PM
Hello!
Please could you do me a favor and attach a working VI where I can save data into multiple excel sheets?
Thanks very much!
Bill