Column index not set or invalid when excel is not visible

i’m trying to sort a column in an excel file, inside the column are strings. i use sort data table activity to sort the column with index 1 (second column).

it works fine when the excel was opened when i run the process. but when the excel wasnt open (not visible) , it shows error “column index is not set or invalid”. i also tried using
assign dt = dt.AsEnumerable.OrderBy(Function(d) d(1)).CopyToDataTable ,
but the result is the same, works when excel was opened, doesnt work when its not visible.

any solution guys ?

1 Like


Have you checked Add Headers option for Read Range activity in properties ?

the column doesn’t have any headers, so if i checked add headers, it wont read the first row, that’s why i read them without headers → sort → write it from cell A2 → write the headers using write cells

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.