LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Taking Excel Data Doesn't Bring Custom Format

Solved!
Go to solution

So, I have written a program that searches for excel files with a file name matching a certain format. Based on which format the cell falls into, I pull the data (approx 60-70 cells) and store the data in one of approx three dozen summary sheets. This winds up with maybe 12-50 rows depending on the summary type.

 

In the past I did this with strings for simplicity as they are easy to search/split/etc. But now, due to the fact that no one here can't keep anything in at least a similar format (i.e. people write different units, micro vs mili, 0.65 vs 65%, and abbreviations) which is unnaceptable.

 

I am now trying to make this human proof, however, there is a main issue. So, I can format the basic file using custom format, no problem (#"g/ml" for example). But I when I take the data, store it in labview, and write it back to a newly created summary sheet it will not bring the custom (or any) format along.

I found the function to write a custom format, but can't find anything that grabs the current format.

 

And no, I can't just format the columns in the summary sheet, as they vary for each process slightly...

0 Kudos
Message 1 of 8
(4,084 Views)

There is an Excel Set Cell Format, which means you can create a similar function that will Get Cell Format.  Shouldn't be too hard.

aputman
0 Kudos
Message 2 of 8
(4,047 Views)

You will also probably have to do this cell by cell if you're not sure all the cells in the range have similar formatting.

 

Ben64

0 Kudos
Message 3 of 8
(4,031 Views)

Thats crazy... I wonder if I haven't updated in a while or something.... I cant find it for the life of me...

0 Kudos
Message 4 of 8
(4,025 Views)

Even Googling I'm just finding info on Excel set cell format, I can't find anything on Excel get cell format...

0 Kudos
Message 5 of 8
(4,021 Views)

I didn't say there was a Get Cell Format.  I said it wouldn't be difficult to make your own function to do that.  

aputman
0 Kudos
Message 6 of 8
(4,016 Views)
Solution
Accepted by topic author LukeWUSM

@LukeWUSM wrote:

Even Googling I'm just finding info on Excel set cell format, I can't find anything on Excel get cell format...


It doesn't exist, you will have to create it. Use Excel Get ActiveX References.vi and do something like this (incomplete).

 

ScreenShot008.pngBen64

 

 

0 Kudos
Message 7 of 8
(4,014 Views)

AH thank you, I totally misread that. I just felt dumb, I wrongly assumed if they had a set function they would have a get function as well and somehow I was missing it!

0 Kudos
Message 8 of 8
(4,009 Views)