LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tdms file writing in red color

Solved!
Go to solution

Hello!

 

I would like to know if is it possible to write a column in excel (with a tdms file) in a color. Or if it is possible to make the word 'Failed' appear as red in the excel file.

 

Thanks in advance!

 

Jessica

0 Kudos
Message 1 of 9
(3,471 Views)

So you are writing to TDMS files and then opening them in Excel using the TDMS Import plugin? TDMS is a binary measurement data file format - it only stores the raw measurement data and has no formatting etc. If you want to format the workbook after it has been imported, you will need to do this after importing (e.g. using an Excel macro).


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 9
(3,457 Views)
Solution
Accepted by topic author jess1006

Check out this TDMS to Excel conversion I made.

 

https://decibel.ni.com/content/docs/DOC-36555

 

It takes a TDMS and turns it into an Excel file, but it makes all cells that contain Pass green, and all that contain Fail red.  It also creates a better summary worksheet, and freezes the first row and column in the data worksheets.  You can take it and do something similar, after the import is done, do ActiveX work to make the file what you really want, then save it.

Message 3 of 9
(3,435 Views)

Thanks a lot for the example!

 

I'm struggling to get all the ..ogtk.vis that you have in your code so i haven't been able to try it...

I think probably i could get them from the VI Package Manager but i can't donwload any packages to my library. 

Could you please upload those 3 VIs?..

 

Thanks so much again!

Jess

0 Kudos
Message 4 of 9
(3,409 Views)

@jess1006 wrote:

 

I'm struggling to get all the ..ogtk.vis that you have in your code so i haven't been able to try it...


The OpenG packages that are required are in the zip.  With VIPM installed just double click the VIPC file and it will prompt VIPM to install the dependencies.

0 Kudos
Message 5 of 9
(3,364 Views)

Hi Hooovahh,

 

I have performed some changes in the VI as example that you show me (I deleted some cases and added some, i am attaching a vi i attached in the case i added so you can run it) however it is not saving the excel file with the same name as tdms file anymore.

 

Could you guess why?...

 

Thanks a lot in advance

Download All
0 Kudos
Message 6 of 9
(3,311 Views)

@jess1006 wrote:

 

Could you guess why?...


Yes because you deleted the part of the code that performed this function.  In the Save File case it used to have code where it would take the TDMS path, pull out the file name, and replace the extension with .xlsx.  If a path was given in the Path to New XLSX then it would be used if it is a file.  If it was a directory, then it would use the TDMS name but with the xlsx extension.  All of this code was deleted and replaced with a single path control labeled Path XLSX file.

0 Kudos
Message 7 of 9
(3,297 Views)

Yes I see, I have fixed it. Thank you very much!

Btw do you know if it would be possible to open the excel file using the system exec vi?

 

I will execute first the vi for transforming from tdms to xlsx, then I will add the images and finally I would like to open and show the excel file (i cannot add the images within the same vi cause the excel file is read-only until the vi has finished running).

0 Kudos
Message 8 of 9
(3,280 Views)
Message 9 of 9
(3,274 Views)