public static XDocument Process(string excelFile) { IWorkbook workbook = WorkbookFactory.Create(excelFile); ExcelToHtmlConverter excelToHtmlConverter = new ExcelToHtmlConverter(); excelToHtmlConverter.ProcessWorkbook(workbook); return(excelToHtmlConverter.Document); }
private void Test(string fileName) { HSSFWorkbook workbook; workbook = ExcelToHtmlUtils.LoadXls(fileName); ExcelToHtmlConverter excelToHtmlConverter = new ExcelToHtmlConverter(); excelToHtmlConverter.ProcessWorkbook(workbook); using (var sw = new FileStream(Path.ChangeExtension(fileName, "html"), FileMode.Create)) { excelToHtmlConverter.Document.Save(sw); } }