1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > c# 把excel转换html c# word excel text转html的方法

c# 把excel转换html c# word excel text转html的方法

时间:2023-05-13 02:27:44

相关推荐

c# 把excel转换html c# word excel text转html的方法

#region 预览Excel

///

///预览Excel///

public string PreviewExcel(string physicalPath, stringurl)

{

Microsoft.Office.Interop.Excel.Application application= null;

Microsoft.Office.Interop.Excel.Workbook workbook= null;

application= newMicrosoft.Office.Interop.Excel.Application();object missing =Type.Missing;object trueObject = true;

application.Visible= false;

application.DisplayAlerts= false;

workbook=application.Workbooks.Open(physicalPath, missing, trueObject, missing, missing, missing,

missing, missing, missing, missing, missing, missing, missing, missing, missing);//Save Excel to Html

object format =Microsoft.Office.Interop.Excel.XlFileFormat.xlHtml;string htmlName = Path.GetFileNameWithoutExtension(physicalPath) + ".html";

String outputFile= Path.GetDirectoryName(physical

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。