My process loops through a folder and checks excel files for a specific sheet name “GL Queries”. If one or many is found, it then loops through them to manipulate and filter rows.
I am currently using the Get Workbook Sheets activity within the current workbook scope and outputting a list variable named list_fileSheets. I have created another variable named list_fileSheetsFiltered. Both are type: System.Collections.Generic.List<System.String>.
I am then using an Assign activity and setting it as such: list_fileSheetsFiltered = list_fileSheets.Where(Function(b) b.Contains(“GL Queries”, StringComparer.CurrentCultureIgnoreCase)).ToList.
Complier error(s) encountered processing expression “list_fileSheets.Where(Function(b) b.Contains(“GL Queries”, StringComparer.CurrentCultureIgnoreCase)).ToList”. Option Strict On disallows implicit conversions from ‘String’ to ‘Char’. ‘System.StringComparer’ cannot be converted to ‘System.Collections.Generic.IEqualityComparer(Of Char)’ because ‘Char’ is not derived from ‘String’, as required for the ‘In’ generic parameter ‘T’ in ‘Interface IEqualityComparer(Of In T)’.
Multiple users are naming these sheets, so I would prefer the “filter” match with strings that are in any case.
Not a huge .Net developer so I can’t tell why it’s not working (other that reprint the error message). But maybe I can give you a couple of alternatives:
Non fancy: list_fileSheets.Where(function(b) b.toUpper(“GL QUERIES”))
Thank you for the response! Option A could work if I set the current sheet ToUpper as well, otherwise it wouldn’t match. I’ll leave this as a backup plan in case I cannot do it all in one step!
As for option 2, I do not have a lot of experience with Regex. I tried inputting your solution, but I received this message:
Compiler error(s) encountered processing expression “list_fileSheets.Where(function(b) Regex.isMatch(b, “GL Queries”, RegexOptions.IgnoreCase))”. ‘Regex’ is not declared. It may be inaccessible due to its protection level. ‘RegexOptions’ is not declared. It may be inaccessible due to its protection level.
I definitely think this is the right direction! Any further troubleshooting is appreciated!!
That did the trick! So simple! I’m still relatively new to UiPath and it did seem as if I was missing some sort of using statement. I wasn’t even aware of the import tab!