Read Range and PreserveFormat

I have a large Excel file where i need to preserve the format but the “Uipath.Excel.Activites.ExcelReadrange” is really slow when the “PreserveFormat” box is checked.

Is there any other way to do this faster?

Is it possible to just use the “Uipath.Excel.Activites.ExcelReadrange” and only read specific columns and preserve the formats of those?

Currently it looks like this:
image
Directly after the Read Range i have a filter datatable where I am only interested in 4 columns.

Can i do like this:
image
Or will this read the entire excel sheet 4 times first starting from “A3” and then from “C3” and so on?

What is the best way to make this as fast as possible?

I Am yet to try this, yet, as per my knowledge, I Don’t think this would work , by giving range like this.
You have to use four read range activities for four different columns if the columns are not continous.

Yeah, I feel like this only will make it take longer, is it a way to only read specific columns(and keep the format) instead of the whole file from the “A3” in this case.

Alternative i could think is, to use Read Column Activity. This can be used to read only those columns you need and later use it accordingly.

Ok, how do i merge these 4 columns into a datable.

Read Range(Datatable):
image
Read Column(IEnumerable):
image

Add Data Column activity can be used.
Yet, there is a catch. The read column activity returns a different type (IEnum) and Add Data COlumn needs System.data.datacolumn

Type conversion has to be done.

Else, read range ( give range of single column) - this is easier as it would return data table itself which can be used with merge data tables

Thanks,
Arun

Okey, thanks.

You say " Else, read range ( give range of single column) - this is easier as it would return data table itself which can be used with merge data tables"

How do i give Read range the command to only read a single column?

You have to give ‘A:A’ - i.e, for whichever column you need to read. this example reads entire A column.

Please mark as answer if it solves your issue

Yes i will.

Lets say i want to only read the column “A3” how do i type it in here?
image
It needs to start on the 3rd row.

A3 is a cell, not column.
If you need only A3 cell, you can use read cell activity

I dont think we are on the same page. What should i type in here:
image

To only read the column A but it needs to start on the 3rd row.

I currently have it like in the picture. It starts at “A3” and reads the entire excel file from there.

Ah! That case “A3” is enough. it should read entire column A starting from A3

But i only want to read specific columns.

U said this earlier:

"Add Data Column activity can be used.
Yet, there is a catch. The read column activity returns a different type (IEnum) and Add Data COlumn needs System.data.datacolumn

Type conversion has to be done.

Else, read range ( give range of single column) - this is easier as it would return data table itself which can be used with merge data tables

Thanks,
Arun"

I am interested in the balded part and also this:

"You have to give ‘A:A’ - i.e, for whichever column you need to read. this example reads entire A column.

Please mark as answer if it solves your issue"

I think we are misunderstanding each other.

I Believe, you need this - “A3:A10000” .

1 Like

I will try this out. Will it always need to read through 10000 rows or does it stop when if lets say row 5000 is empty?

Does empty rows take much time for the robot to read through?

It has to be any number greater than your expected num of rows.

Yeah, it is to slow. Is there any other acitivity that is faster that also preserves the format?

This is the best solution i could think of! Slowness can be due to multiple reasons, not specific to this activity.