Write range with same format in uipath

Hi All,

Thanks in advance…!

How to write range activity using in UiPath with format from excel

Like Excel having data with format but using write range output will be without format. I require the same with format

Hi @SURESH_P ,

We usually prepare the Excel Templates (Formatting +headers as is and empty the rows) before hand and then write the data to that template file (Or a Copy of the Template renamed to required file name) from the second row onwards.

Is this something that could be checked from your end and let us know if it is a feasible approach for your case?

If not, let us know what is the challenge and maybe we would require to check with VBA Codes.

Also, Maybe the Format Cells activity could be checked as well, if the data is less.
Some examples using the Activity :

@SURESH_P

one way to acheive is…first use copy paste range activity and paste the first row till where you need

then use write range activity from workbook…it would retain the formats

Alternate approaches are present as well…

cheers

in your excel template, do the following

  1. right click column, click format cells, then select Text and click OK

  2. highlight the same column then click Data->text to columns,
    under column data format select Text

  1. now everything you write in that column will be in text format hence same format
    image

  2. you need to repeat this for other columns where the format is not the same.

you can try my component

use this function, it lets you apply the above steps for one or more columns
image

Hello @SURESH_P

  1. Use the “Excel Application Scope” activity to open your Excel file (set “Visible” to “False” to make it run in the background).
  2. Within the “Excel Application Scope,” use the “Write Range” activity to write your data to the Excel sheet.
  3. In the “Write Range” activity, set “PreserveFormat” to “True” to ensure that the formatting in your data is retained in the output Excel file.

Thanks & Cheers!!!

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