01-15-2019 01:01 PM - edited 01-15-2019 01:03 PM
In a 2D table is there a way to extract the value or text that has been entered in a specific cell? I'm doing this to look up a value that has been entered by hand and then I will conditionally format based on that value.
I have tried the following and got an error that says this is not supported:
Target_Value=Report.Sheets("TestSheet").Objects("2DTable1").Columns.Item(1).TextList.Item(1)
01-16-2019 10:51 AM
Hi BrianCT,
It's hard to make a recommendation for next steps without background information about your 2D table and what it contains. Could you post your TestSheet so we can see what data types you're working with?
Off the top of my head, it looks to me like you specified a column but not a row.
01-16-2019 11:51 AM
I can not post the actual 2D table here, company security. The table text is made up of numbers.
I was under the impression that the item(#) would refer to a row.
02-19-2019 04:29 PM - edited 02-19-2019 04:30 PM
Hi Brian,
First off, I'd recommend you break down those object levels into separate commands and object variable assignments. It's vastly better for debugging, and you often end up using the intermediate objects more than once, which makes it more convenient also and less tedious to type and read.
Set Sheet = Report.Sheets("TestSheet") Set Table = Sheet.Objects("2DTable1") Set Column = Table.Columns(1) Set TextList = Column.TextList(1) Target_Value = TextList.Text
The actual point you were missing in that super long command line was that the TextList is an object which has the property TextList.Text. Once you add on ".txt", your old code should probably work. Of course if it doesn't, good luck figuring out why with one long command line traversing the whole object tree...
Brad Turpin
DIAdem Product Support Engineer
National Instruments