Convert column index to Excel column letter

Hi,

I get the column index with dt.Columns.Indexof(columnName) as int and when I try to convert it to char like this: Convert.ToChar(columnIndex+65).ToString
it’s giving me the wrong value. The end index is 34 which is okay but the column letter it is giving me at the end is “c”

Hi,

Can you try to use UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter method as the following?

for example,

UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(34) 

returns AH. This input column number is R1C1 style index, so if you use 0-based index, you need to add 1.

img20211020-a

Regards,

5 Likes

Hi

Have a view on this component from UiPath market place

Cheers @markosc

Thank you very much

1 Like

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