Created
January 15, 2024 00:09
-
-
Save conholdate-gists/a518872821ad926cc5943cf25af91a0c to your computer and use it in GitHub Desktop.
Convert HTML to Excel XLS XLSX in C# | Webpage to Excel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the source HTML file | |
using (Converter converter = new Converter("input.html")) | |
{ | |
// Set the convert options for XLS format | |
GroupDocs.Conversion.Options.Convert.SpreadsheetConvertOptions options = new GroupDocs.Conversion.Options.Convert.SpreadsheetConvertOptions() | |
{ | |
PagesCount = 1, | |
Format = GroupDocs.Conversion.FileTypes.SpreadsheetFileType.Xls | |
}; | |
// Convert HTML to XLS format | |
converter.Convert("HTMLtoXLS.xls", options); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the source HTML file | |
using (Converter converter = new Converter("sample.html")) | |
{ | |
// Set the convert options for Excel format | |
GroupDocs.Conversion.Options.Convert.SpreadsheetConvertOptions options = new GroupDocs.Conversion.Options.Convert.SpreadsheetConvertOptions(); | |
// Convert HTML to XLSX format | |
converter.Convert("HTMLtoXLSX.xlsx", options); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment