The string function ‘EndsWith’ is case-sensitive, even in VB.Net, so if you’re looking for a certain string (maybe the file extension, in a filename), you need to make sure you’re looking for the correct thing, since ‘xls’, with case-sensitivity, is different than ‘XLS’.

So, if you’re function is looking for ‘xls’, you must make sure that you make adjustments to the filename string, in order to catch things like this. To do this, you would need to change:

if myFilename.EndsWith("xls")

to

if myFilename.ToLower.EndsWith("xls")