I am having a problem trying to keep track of some Excel Files and Sheet names.
These excel files and sheets are created dynamically, when a user clicks some buttons is creates the excel file and the sheet. I have been trying to use an arraylist but for some reason it is loosing files. Is there a better structure I can use that can relate File to Sheet and Sheet to File.

I have thought about a Hashtable for each excel file be the key (since they will always be unique) and value as the sheet name but I need to file name as well.

Here is the code I am using this far...

cQueueExcelFiles and cSheets are both arraylist.
VB Code:
  1. ///<summary>
  2.         /// Gets the next excel file in the queue, returns null if nothing left in queue.
  3.         ///</summary>
  4.         public string XlNextFile
  5.         {
  6.             get
  7.             {
  8.                 string next = null;
  9.  
  10.                 try
  11.                 {
  12.                     next = (String)cQueueExcelFile[this.cQueueExcelFile.Count - 1];
  13.                     cQueueExcelFile.Remove(next);
  14.                 }
  15.                 catch (ArgumentOutOfRangeException)
  16.                 {
  17.                     next = null;
  18.                 }
  19.                 return next;
  20.             }
  21.         }
  22.  
  23.         ///<summary>
  24.         /// Returns the next excel sheet name.
  25.         ///</summary>
  26.         private string XlNextSheet
  27.         {
  28.             get
  29.             {
  30.                 string next = null;
  31.                 try
  32.                 {
  33.                     next = (String)this.cSheets[this.cSheets.Count - 1];
  34.                     cSheets.Remove(next);
  35.                 }
  36.                 catch (ArgumentOutOfRangeException)
  37.                 {
  38.                     next = null;
  39.                 }
  40.                 return next;
  41.             }
  42.         }
  43.  
  44. ///<summary>
  45.         /// Sets the Excel Files waiting to be processed in a Queue.
  46.         ///</summary>
  47.         public string XlQueueFile
  48.         {
  49.             set
  50.             {
  51.  
  52.                 if (this.cQueueExcelFile == null)
  53.                 {
  54.                     cQueueExcelFile = new ArrayList();
  55.                 }
  56.                 this.cQueueExcelFile.Add(value.ToString());
  57.             }
  58.  
  59.         }
  60.         #endregion