excel 转化 html 问题
最近在做一个项目,其中遇到excel 预览问题,能不能将excel转化为html呀最好有一个函数参数为excel的url 返回值为布尔类型,为真表示转化成功,否则转化失败
class PreivewFile{
private const string excelToHtmlSavePath = "……";
public bool excelToHtml(stirng excelFileUrl)
{
^……
}
}
谢谢回答! --------------------编程问答-------------------- protected void ExcelConvertToHtml(string xlsPath, string htmlPath)
{
try
{
Excel.Application app = new Excel.Application();
app.Visible = false;
Object o = Missing.Value;
_Workbook xls = app.Workbooks.Open(xlsPath, o, o, o, o, o, o, o, o, o, o, o, o);
object fileName = htmlPath;
object format = Excel.XlFileFormat.xlHtml;
xls.SaveAs(fileName, format, o, o, o, o, XlSaveAsAccessMode.xlExclusive, o, o, o, o);
object t = true;
app.Quit();
}
catch (Exception ex)
{
}
} --------------------编程问答-------------------- 打开EXCEL文件
FileStream fs = new FileStream操作生成HTML
补充:.NET技术 , C#