Option Strict On disallows implicit conversions from 'System.Data.DataTable' to 'System.Collections.Generic.IEnumerable(Of Object)'

Hello,

I am creating a process that requires reading a column (E) in an .xlsx, and pasting the column (as a string) into a text box on another application. I am using the Excel Application Scope and also the Read Range activity within it. I know the Read Range activity outputs a Data Table (which I have titled “TeamStyles”), and I know I can convert the Data Table to a string via the Output Data Table activity.

Here is the properties for the Read Range activity:

However, I keep getting an error: Option Strict On disallows implicit conversions from ‘System.Data.DataTable’ to ‘System.Collections.Generic.IEnumerable(Of Object)’ that won’t let me even begin to debug my project.

A few things to note:
1.) I am aware that the “For Each Row” activity would fix this error, but I am not using that at all (and even when I did try to use it, I got the same error).
2.) The Excel Application Scope is the very first time the Data Table (TeamStyles) is referenced, which is why I only pasted that section as a screenshot.
3.) I have also tried the “Read Column” activity, but it is not giving me the results I want within my process.

Your screenshot doesn’t show which activity is generating this error.

Hi Paul, thanks for your response! The error does not tell me which activity is causing the error - whenever I press the “Debug” button, I get a pop-up informing me of validation errors and when I close out of it, here is what I see:

That is why I attached the screenshot of the Read Range activity because that is literally the first time the TeamStyles data table shows up in the sequence, so I assume it has to do with that activity.

That’s an incorrect assumption. Somewhere you have an activity with a red icon on it, indicating it’s got an error. If you look in Error List you should see this same error, and should be able to double-click it and it’ll take you right to the offending activity.

Paul, THANK YOU! I am new to UiPath and was unsure of how to find activities with errors and your response helped so much and actually fixed my issue. I have multiple IF statements that do similar things, and I never updated the other IFs outside of my main one. The other IF statements were still using the Read Column activity, and removing those has my project running smoothly now.

Thank you so much again, so happy to know it was an easy, overlooked fix!

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