Excel column question

Hi,
I am reading data table rows. One of the columns reads as “Employee Number(User ID)”. So if I assign it as dt(rows(0)(“Employee Number(User ID)”), getting an error due to the additional Parenthesis.

Please suggest the work around.

Thank you,

@A_Learner

dt.Rows(0)("[Employee Number(User ID)]")

1 Like

Hi @A_Learner

Since you have mentioned that you column name is being read like "Employee Number(User ID)" use the below syntax to resolve the issue.

dt.Rows(0)("""Employee Number(User ID)""")

Regards

1 Like

@A_Learner,

You can use it like dt(rows(0)(“[Employee Number(User ID)]”).

You can also use Column index if it’s fixed.

dt(rows(0)(1)

Here we assume, column is second column. Column index will start from 0.

Thanks,
Ashok :slight_smile:

1 Like

Getting an error saying that [Employee Number(User ID)] does not belong to data table.

Do not want to hard code column index in case position changes.
Thank you

without square brackets worked fine.

thank you,

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