02-16-2007 01:35 PM
02-18-2007 10:25 AM
Hello Nick,
It looks like your main problem is that your "Write to Excel.vi" does not actually write to an Excel formatted file. It looks like you're using the "Write to Spreadsheet File(strings).vi" to get your data to disk. This VI writes the data a ASCII data formatted in a way Excel can read it. (tab or comma delimited) This is an assuption because you did not attach your version of "Write to Spreadsheet File(strings).vi". If you've modified this VI to write to Excel using ActiveX, then please attach it so we can have a look at what's going on.
I think what is happening is that you are writing an initial file, opening it with your "worksheet.vi" to set the sheet name (probably works) but then you write to the same .xls file using the "Write to Excel.vi" again. But since this just writes basic text and not real Excel, the original file is just overwritten.
If you have the Report Generatikon Toolkit, you can easily use the VI's from that to write directly to an Excel formatted file targeted to a specific sheet and do what you need. If not, you'll need to build a VI that uses ActiveX to write to Excel.
This Dev Zove article has an example that should get you started.
Let us know how it works out for you.
Ed

Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.02-20-2007 02:23 PM
02-20-2007 02:24 PM
02-20-2007 02:24 PM - edited 02-20-2007 02:24 PM
Message Edited by Nick_C on 02-20-2007 03:26 PM
02-20-2007 02:25 PM
02-20-2007 03:29 PM
To check if a file already exists, you could use the "File/Directory Info" function found on the 'File IO>Advanced File Functions' palette. Give this function a path and if the file is not there, the function will generate an error with a code of 7. This indicates a File not Found error. No error indicates that the file does exist.
I'm not sure what you mean in your second question. You can pass an array into a subVI using a control connected to a terminal. Can you give a few more details on what are you trying to do?
Ed

Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.02-20-2007 03:37 PM
02-21-2007 09:25 AM
I eluded to the answer in my last reply, but I guess you didn't catch it.
What you need to do is connect the 2D array control on the front panel of the subVIs to a terminal on the icon/connector pane. Then you can create either a block diagram constant or front panel control of the arrays and connect them to the new terminals you created on the subVIs.
Ed

Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.02-21-2007 02:43 PM