Writing a list in the columns of excel sheet

Hi everyone,

Can you please help me, how to write a list in a column of excel sheet.

Explanation: I have two lists containing more than 500 elements, I want to write those 2 lists in column 1 and column 2 of excel sheet


these lists contain strings

1 Like

Good morning Hemant,

You should be able to write your list using the “Write Range” activity for Excel.

You can specify which cell each list is written to (A1, B1), which will enable you to write both ranges next to each other in the workbook.

there is an error of conversion, the list contains string, should I be using any conversion formatters?

Do you have an array of strings or is your list of values in a datatable?

this is the issue, can you suggest me what to do with this :smile:

Try the following steps hemant:

  1. Build Datatable
  2. For Each (loop through the strings in your array)
  3. Add Row to DataTable (this will use the values from your array and add them to the datatable in step 1)

Even for a large number of records, this will process very quickly.

Hi @chenderson,

Based on the below image, I would like to create a list of strings based on those 3 columns. Can you help?

I was reading the excel Range, then for each row, I was using the invoke method. However my TargetObject (holidaysList) is of type Systems.Collections.Generic.List<System.Collections.Generic.List<System.Collections.Generic.List<System.String>>>


May I know why you need a List(Of String). If you need three different list then you need to do individual column conversion into List(Of String).

But as you mentioned Nested List can be done, but the current data you shown is not the right candidate for that.

Hi @sarathi125, actually I am not so used to Lists.

But what I would like to have only one List with 3 columns. For example,

List(0)(0) = Tuesday
List(0)(1) = January
List(0)(2) = 01/01/2019

List(2)(0) = Friday
List(2)(1) = April
List(2)(2) = 04/19/2019


Then you can store a string array inside a List, and then you can use it.

1 Like