LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Want to write a time string to excel.

I have an array of strings I'm writing to excel, one is a time string that looks like this 12:24:13.321 that I'm sending to 'write string to spreadsheet' along with string of other numbers. When I open the the excel file, the time looks like 24:13.3 but if you click on the cell, excel still knows the hour, but seems to lose the milliseconds. all the other numbers are fine. How can I format this so it keeps the hour and milliseconds?
0 Kudos
Message 1 of 5
(3,122 Views)
You need to set the "Format" of the cell to "hh:mm:ss.000". You can either do this programmatically or manually.
Message 2 of 5
(3,122 Views)
how do i do this programmatically? (without useing a report vi)
0 Kudos
Message 3 of 5
(3,122 Views)
Plain ol' ActiveX (Report Toolkit is a nicely wrapped version of the basic ActiveX calls).

Example attached is LabVIEW 6.1 and talks to Excel of Office 2000. Its big and its ugly. I apologize.
Message 4 of 5
(3,122 Views)
For those folks who could not follow, the idea is to set the format for the column in excel to hh:mm:ss.000 for displaying the data.

To set this value programatically, you might be able to do this with activeX calls, but this would require opening Excel and modifying the file there. There are several shipping examples for exporting data to Excel; however,the activeX call will require research at msdn.microsoft.com. Another option might be the use of a template.
0 Kudos
Message 5 of 5
(3,122 Views)