UIPath Studio: Write range Excel output, cell output formatting (col width, borders)

Hi all:

I’ve noticed that although my original Excel file has cell formatting (bolded text header row, borders around all cells, column width adjusted to fit the cell contents), when using Read Range to dump it into a DataTable, the resulting output Excel files from Write Range lose the formatting. Is there a way to preserve the cell formatting into the output or are there activities to perform the appropriate cell formatting prior to Write Range?

I’m trying to avoid programming UIPath to open up each of the resulting files and perform the desired formatting like a human would.

Thanks for your help.

@dlincusa

Welcome to the UIpath Community.

Please check Preserve Formatting option in Excel Application Scope Activity.

hI @dlincusa

CHECK THIS

Thanks
Ashwin.S

@lakshman

Thank you for your quick response. I see Preserve Formatting under the Read Range Activity. I have this checked, but the output from the Write Range activity does not have the desired cell formatting (Bold text header line, borders, adjusted column width). Please see source and output image files attached.

@AshwinS2

Thank you for your quick response as well.

Regarding Invoke Code, is this something I can use between Read Range and Write Range? Please see attached image.

The output here for Filter Data Table is LCLfilterout. Can I apply VB.NET code to this?

Hi @dlincusa

Inside invoke code what are you planning to do

Thanks
Ashwin.S

Hi @AshwinS2

In the attached image, I provided a screenshot of the source Excel going into Read Range and the current output from Write Range. I wish to preserve the formatting (Bold text header line, borders, adjusted column width) in the output, but currently it is not being preserved.

Your original response referenced Invoke Code as a way to change the cell content formatting. I was hoping to use that to achieve my purpose.

Just wondering what is possible. I’m not sure how Invoke Code interfaces with Read Range/Write Range.

Thanks.

Hi @dlincusa

Check this

Format cells of Excel

Thanks
Ashwin.S