Adding an apostrophe beside equal sign in an excel cell without changing the text

I need to add an apostrophe to some cells that has an equal sign(=) in order for powerbi not get an error when running and reading the excel file.

When I find these cells that needs to be formatted for example:

in the output excel file, it looks like this:

however, if I do it manually or my expected output is like this:

It seems like when I find cells with = sign and replace them with '= , it formats the original formula to a value of some sort.

Can someone help on how to retain the cell text formula with an apostrophe at the start without uipath automatically turning it into a value.

Thank you

Hi @molf ,

Could you try this?

(From row In dt1.AsEnumerable()
Let ls = row.ItemArray.ToList()
Let ra = ls.ConvertAll(Function(a) If(a.ToString.StartsWith("="),"'"+a.ToString,a.ToString)).ToArray()
Select dt_result.Rows.Add(ra)).CopyToDataTable()

Kind Regards
Ashwin A.K

1 Like

I will give this a try also thank you!

Hello I got a little confused with the code. how do I exactly try this and what activities to use? thank you :slight_smile:

It seems that from the read range activity, Uipath already treats the cell with the #NULL! value as a number and translates it to -2146826288.

is there a way around this?