LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write text to excel file

I am not able to write any text information into an excel file using the "write to spreadsheet file.vi" icon. Is there anyway this can be done? And also, is there anyway to programmatically format the font size, style and merging cells in excel using LabView 5.1.2?
Please help. Thanks in advance
0 Kudos
Message 1 of 6
(3,690 Views)
By default, this VI is looking for arrays in numeric/DBL format. If you look at the block diagram of the VI, there are instructions near the bottom that tell you how to allow strings/text vs. numbers/DBL.
Another option is to simply 'replace' the numeric controls in the arrays to string controls. This should be what you need, else, please comment back.

As to your 2nd question, I'm not certain, since I've not tried to do that before, perhaps others will respond.

Good Luck, Doug
0 Kudos
Message 2 of 6
(3,690 Views)
Thanks for the help Doug. I think this should solve my problem. I will try to look for a solution to my second part of the question, but would appreciate if you could reply when you figure out. THanks again.
0 Kudos
Message 3 of 6
(3,690 Views)
Instead of using the Write to Spreadsheet.vi, you might want to use the Write Table to Excel.vi that uses ActiveX. If there are properties/methods to change font, etc., then you should be able to get what you want. The hard part (for me anyways) has been finding the right properties and methods in the Excel documentation.
0 Kudos
Message 4 of 6
(3,690 Views)
Not so hard if you look at Visual Basic for Applications help and object browser, all items are listed there.
0 Kudos
Message 5 of 6
(3,690 Views)
A common misunderstanding is that the write to spreadsheet.vi can be used to write to a spreadheet.xls file! The file generated should be called .asc for it is an ascii coded textfile with a format that can be read (imported) by most spreadsheet programs.
So formating is not an issue.

You can use the NI examples for writing to excel or from the developer exchange download our free library to communicate with excel. Our free library is donated to the developer zone.

It is called "Excel Toolkit (GOOP)" and I always find it searching on philips
greetings from the Netherlands
0 Kudos
Message 6 of 6
(3,689 Views)