LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

update existing excel file

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.

 

 

Download All
0 Kudos
Message 1 of 6
(2,402 Views)

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...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 6
(2,398 Views)

I'll check it out, thanks.

0 Kudos
Message 3 of 6
(2,395 Views)

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

 

0 Kudos
Message 4 of 6
(2,369 Views)

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.

0 Kudos
Message 5 of 6
(2,350 Views)
To quote Sgt Preston of the Yukon:

"Well King, this case is closed."

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 6
(2,341 Views)