.NET 将EXCEL转换为Html

一.添加Nuget包:ce.office.extension

 

NetCore使用v2.0.0

NetFramework使用 1.0.0

二.库的使用

Console.WriteLine("Excel_Wait.........");
string pathExcel = @"C:\Users\Administrator\Desktop\Test.xlsx";
File.WriteAllText(@"C:\Users\Administrator\Desktop\OutExceml.html", ce.office.extension.ExcelHelper.ToHtml(pathExcel));
Console.WriteLine("Excel_Done.");

Console.WriteLine("-----------------------分割线-----------------------------");

Console.WriteLine("Word_Wait.........");
string pathWord = @"C:\Users\Administrator\Desktop\Work文档.docx";
File.WriteAllText(@"C:\Users\Administrator\Desktop\OutWord.html", ce.office.extension.WordHelper.ToHtml(pathWord));
Console.WriteLine("Word_Done.");

 

posted @ 2022-08-04 10:44  后跳  阅读(481)  评论(0编辑  收藏  举报