/// <summary>
 /// Creates a new Excel File Writer with one worksheet (the default worksheet) in the workbook.
 /// </summary>
 public ExcelFileWriter( bool createDefaultWorksheet = true )
 {
     workbook = new XLWorkbook();
     AutofitOnSave = true;
     if( createDefaultWorksheet ) {
         var newWorkSheet = new ExcelWorksheet( workbook.AddWorksheet( "Sheet1" ) );
         namesToWorksheets.Add( newWorkSheet.Name, newWorkSheet );
         DefaultWorksheet = newWorkSheet;
     }
 }
 /// <summary>
 /// Loads the worksheets in the opened workbook into a dictionary.
 /// </summary>
 private void loadWorksheets()
 {
     foreach( var worksheet in workbook.Worksheets )
         namesToWorksheets.Add( worksheet.Name, new ExcelWorksheet( worksheet ) );
     DefaultWorksheet = namesToWorksheets.First().Value;
 }
 /// <summary>
 /// Adds to the workbook and returns a new ExcelWorksheet.
 /// </summary>
 public ExcelWorksheet AddWorksheet( string name )
 {
     var newWorkSheet = new ExcelWorksheet( workbook.Worksheets.Add( name ) );
     namesToWorksheets.Add( name, newWorkSheet );
     return newWorkSheet;
 }