@V_Roboto_V
Thanks checking this
If i give the column name “Bill Date” its not filtering correctly
Please see below sheet which have previous year and future
Yes, you are getting an error because Date.ParseExact expects a string date value, but you are passing column names directly. You need to extract the actual date values from the Excel file before parsing them.
Solution: Checking if Any Sheet Has Previous or Future Year
You can iterate through all sheets, extract the date column values, and check if any date falls outside the current year. If such a date exists, you can flag that sheet.