I did like this:
if (Excel._Application.ActiveWorkbook != null)
{
List sheets = new List();
foreach
In your condition, you can use Worksheet.CustomProperties as alternative to hold unique property of the sheet.
Worksheet ws = **current_sheet** as Worksheet;
ws.CustomProperties.Add("SheetID", **some_value**);
So, later on you can access them as
foreach (Excel.CustomProperty prop in ws.CustomProperties)
{
if (prop.Name == "SheetID")
{
// access as prop.Value and prop.Name
}
}
Hope this helps.