LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

writing array of time strings to excel

Hello, and thank you in advance for any help.

I am writing a 2-D array of strings to an excel sheet.  The first collumn of the array contains time strings in the form hr:min:sec.xxx (xxx being fractions of a second.  For some reason, when I open this in excel that first collumn is wrong.  Even if I format those cells as Time, it will leave out the fractions of a second which it displays fine in labview.  Can anyone offer advice on how to recieve the correct data in excel?

Attached is how I write the time string and how I write the 2-D array to a spreadsheet file.

Thank you,
Steve
0 Kudos
Message 1 of 5
(3,105 Views)
your vi is right
In excel, right click to format the cells, under Number, select Custom from the category list.
enter hh:mm:ss.000 into the type box

there ya go! Smiley Happy


2006 Ultimate LabVIEW G-eek.

Message 2 of 5
(3,095 Views)
Thanks 🙂

Do you know of a way to send that formatting command through labview??
0 Kudos
Message 3 of 5
(3,090 Views)
The short answer is yes.  I know you can do it through ActiveX controls (there's a Property Node for the active workbook's active sheet's cell range called Number Format where you simply wire the above format).  The problem is that you seem to write a file and then open it up in excel independently, versus populating excel via labview (there's shipping examples of this).  But it seems like a lot of work to go through, and I can't dummy one up at the end of the workday Smiley Wink

Maybe someone else has a better idea?

Message Edited by Jonnie 5 on 08-08-2006 05:01 PM



2006 Ultimate LabVIEW G-eek.

Message 4 of 5
(3,086 Views)
The problem is you are not writing a true excel file. You are writing a tab delimited file and giving it a .csv extension so that excel will open the file when opened inside windows. You can cure your problem a couple of ways.
 
  1. Use activeX and write to excel directly (not recommended)
  2. You could creat a Macro in excel that will do the formatting for you.

I would use the later of the two.

Why are you so worried about fractions of a second being displayed anyway?




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 5 of 5
(3,071 Views)