/// <summary>
/// 将excel转化成html页面
/// </summary>
/// <param name="filePath">excel路径</param>
/// <param name="savePath">生成的html保存路径</param>
public static void ExcelToHtml(string filePath,string savePath)
{
//Specify the HTML Saving Options
HtmlSaveOptions save = new HtmlSaveOptions(SaveFormat.Html);
//Instantiate a workbook and open the template XLSX file
Workbook book = new Workbook(filePath);
//Save the HTML file
book.Save(savePath, save);
/// 将excel转化成html页面
/// </summary>
/// <param name="filePath">excel路径</param>
/// <param name="savePath">生成的html保存路径</param>
public static void ExcelToHtml(string filePath,string savePath)
{
//Specify the HTML Saving Options
HtmlSaveOptions save = new HtmlSaveOptions(SaveFormat.Html);
//Instantiate a workbook and open the template XLSX file
Workbook book = new Workbook(filePath);
//Save the HTML file
book.Save(savePath, save);
}
要引用 Aspose.Cells.dll
本文介绍了一种使用Aspose.Cells库将Excel文件转换为HTML的方法。通过指定HTML保存选项,并利用Workbook类加载Excel文件,最终可以将Excel内容完整地保存为HTML格式。
1460

被折叠的 条评论
为什么被折叠?



