Hello guys,
i have a “Column not found” error in For each Datatable given below
Here 46th column is a remark column.
I have used the same for each just above this error but iam not getting any error on that
Hello guys,
i have a “Column not found” error in For each Datatable given below
Here 46th column is a remark column.
I have used the same for each just above this error but iam not getting any error on that
It clearly means col 46 does not exist in this DataTable. Are you accessing columns using index?
Can you share a ss of col or linq you are using ?
The “Cannot find column 46” error usually means the column doesn’t exist at the specified index. A couple of things to check:
For Each loop to print out the column names and confirm that “remark” exists in your DataTable.Example:For Each col In YourDataTable.Columns
Log Message: col.ToString()
Next
If YourDataTable.Columns.Contains("remark") Then
' Access the remark column
Else
' Handle missing column
End If
The column exists on 46th index.
For testing i have used a separate for each loop, it is going through and also i have used a for each just above this error that is also passing through any error.
Add a Write Line(dt.Columns.Count.ToString) to confirm.
Use the column name instead of index:
CurrentRow("Remark").ToString
If you want, share your Read Range, DataTable name, and the exact line where you access the column — I can help you pinpoint it.
UiPath is not reading all columns from your Excel file.Even though Excel shows column AU (47th column)…
UiPath is reading less columns, maybe 40 or 43.
Can you try to read excel with Range: “A1:AU5000”. Lets test with this.
After Read Range, Add a Log Message:"Colun count = " + dt.Columns.Count.ToString.
Then we will come to know if we read all cols are not.
Mostly it will read all columns then. Can you give a try and let me know