Worksheets.Worksheet(Sheetname) , Sheetname must be exacly the name of the sheet(lowercase and uppercase also)

Oct 27, 2011 at 11:05 AM
Edited Oct 27, 2011 at 11:05 AM

I've an .xlsx file with a worksheet name : Pepito

Accessing to that worksheet using lWorkBook.Worksheets.Worksheets("Pepito") works ok

But accessing to that worksheet using lWorkBook.Worksheets.Worksheets("PEPITO") throws an exception.

If you try, in excel 2007, to create a sheet with name "Pepito" and another with "PEPITO" it says that name "Pepito" cannot be used again.

Why cannot access to a cell without seeing uppercase or lowercase matches?

Oct 27, 2011 at 4:25 PM

I changed it so it doesn't require proper case from now on...