Sort Data in Excel without Table Name

Hello,

I’m trying to sort data within a column in an excel sheet in my automation. I’m using the sort table activity within an excel application scope.

The problem I’m having is the excel files do not have a table name. When an excel file does not have a table name how can the data be sorted?

Any help would be appreciated. Thank you!

image

Hi @Kevin_Legendre
You have to use sort data table activity to sort excel data

The default table name will be Table1.

@Priyanka_Ramesh

Thanks for the response. I tried that and got the following error. I also included my sort activity.

image

image

Couple of approaches here, hinging on the fact that data in an excel file isn’t necessarily in a ‘table’ unless it has specifically been designed that way.

  1. If you have control over the excel file, just convert the data to an actual table. to do this you will go into the file, highlight the data you want to make into a table, then go to the Insert Ribbon and then to table,


    excel will guide you through the rest. this will set the data as an actual table and you can give it a name which you can use in that activity.

  2. If you dont have control over the file, then read the file into UiPath, then use a sort datatable activity instead. it will sort the Datatable which is in the the robots ‘memory’ at that point, and you can then write that sorted table back into your original file, having the effect of sorting the data in excel

I hope this helps

Hello @Kevin_Legendre,

I would recommend you, read range activity and then sort data table:

image

The output will be another data table and then use write range activity.

It is not necessary to use applciation scope!

@Djh

Perfect, went with the second solution and that worked. Appreciate the help!

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