public ExcelSheets(GlobalEnums.MappingTaskID mappingTaskID, string excelFile) { InitializeComponent(); try { OleDbAPIs oleDbAPIs = new OleDbAPIs(CommonNinject.Kernel.Get <IOleDbAPIRepository>(), mappingTaskID); List <string> excelSheets = oleDbAPIs.GetExcelSheets(excelFile); if (excelSheets != null) { this.combexSheetName.Items.AddRange(excelSheets.ToArray()); } } catch (Exception exception) { ExceptionHandlers.ShowExceptionMessageBox(this, exception); } }