.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 @   后跳  阅读(535)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
点击右上角即可分享
微信分享提示