06-23-2014 09:32 AM
I'm trying to update an existing excel file using labview on the condition of the value of a simple boolean switch. The program works fine the way it is but I need it to add to an existing excel file that is already formatted. The program I have DOES add to it, but any formatting that I try do on the file is erased whenever I try to rerun the program..... Any help would be appreciated. I attached the program if you need to take a look at it.
06-23-2014 09:36 AM
The problem is that you aren't writing an excel file, you are writing to a text file that is formatted such that excel opens it without complaining. If you need to write to a real excel file, there are examples that ship with LV. Do a search in the examples for "ActiveX".
Mike...
06-23-2014 09:39 AM
I'll check it out, thanks.
06-23-2014 02:42 PM
Also check out the examples that use the Excel Report Object model (you need the Report Generation Toolkit for this). An example would be "Generate Report from Template (Excel)". This is much easier than using ActiveX.
Note that for reasons that are unclear to me, NI treats Excel as basically a Write-Only medium. But as this example shows, by calling the input that you want to read (and modify) a "Template", you can easily read/modify/write any Excel file from LabVIEW.
BS
06-23-2014 09:24 PM
I do not find using ActiveX to control Excel from LabVIEW to be particularly difficult.
If there is something I don't understand, I look at the Microsoft example code using Visual Basic.
06-24-2014 12:46 AM