How to get a cell value from an excel file with LINQ

Hi all, I was wondering, how can I use LINQ, to get the values from an excel file and display it in a message box, also how to get a single cell value from a specific column name and display it using write line with LINQ?

Thank you in advance.


please refer to the following post


Hi @Sidney_Vogel ,

You can use a combination of a Where and FindIndex or IndexOf to achieve whatever it is you want to achieve, but we can only provide the actual LINQ for you once you provide an example of the output that you want.

Does this cell value have to meet any condition, other than being present in a given column?
Do you only want to retrieve that particular cell value, or the position it is present in?
Or do you want the entire column values as a list/array of values?

Lots of questions can be asked, which translates into different ways to develop LINQ.
Please provide some more detail so that we can help you out.

Kind Regards,
Ashwin A.K

hi. i want to get the specific cell value(dt1) and write it in a specific cell value(dt2)


You can use get cell value activity to get the value from the first excel and use write cell activity to write to particular cell.


1 Like

Hi @ldiaz

You could do the following to get and set values to a DataTable

To get a specific value from a cell: DT1.Rows(0).item(0).toString Returns the first Row of the DataTable DT1 and the first element of cell A1 in the DataTable DT1

To set a value to a DataTable in a specific cell: In an assign activity DT1.Rows(0).Item(0) = "SomeValue"

I hope this helps.


1 Like