LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Conditional formating excel activex

Solved!
Go to solution

Hi,

   I am trying to open an excel sheet that has a matrix in it. and I want to set the set the size of the cells to auto-width and auto-height. Also I want to set the font of my headers to bold. I also want to use an array of names where I can check against the first column of the matrix. If any of the array names matches a name in the matrix first column, it should highlight the whole row in red. I am trying to do that programmatically but so far I cant find my way around labview activex.

  would you please direct me.... I attached my VI  in LV 2016

Download All
0 Kudos
Message 1 of 4
(2,869 Views)
Solution
Accepted by topic author ritch_by_nature

Well, I tend to do as much with RGT and as little with ActiveX as possible.  Here's my "Red One Row" (as opposed to another VI, Read One Row) that turns the selective text in the row Red (you can guess what Black One Row looks like).

Red One Row.png

[Confession -- the function "Row Limits", I'm embarrassed to admit, does use ActiveX -- it looks at the UsedRange property of the Worksheet, gets Columns, and sets Row Start's Column to Count-1, the last Column.  However, Next Row is "pure", mostly ...].

 

Bob Schor

0 Kudos
Message 2 of 4
(2,839 Views)

Thanks for replying, but I could not open the row limits vi.. plus I have a feeling the cluster constant with the preset font settings may be for the over worksheet. I am looking to select specific row to color or others to bold.

0 Kudos
Message 3 of 4
(2,828 Views)

@ritch_by_nature wrote:

Thanks for replying, but I could not open the row limits vi.. plus I have a feeling the cluster constant with the preset font settings may be for the over worksheet. I am looking to select specific row to color or others to bold.


You are correct on both observations.  I did not attach Row Limits, rather I told you what it was (ActiveX, and I specified all the steps).  And yes, I specify the entire WorkSheet, but the function I was using to apply the Format specifies the beginning and ending Cell.  My function "Red One Row" turns one row Red by specifying the first Cell of the row, uses Row Limits to get the last Cell of the row, so together they specify the beginning and ending Cell, just what the Excel Set Cell Font function requires.  Did you read the Help for this function?

 

Bob Schor

0 Kudos
Message 4 of 4
(2,806 Views)