withoutaword

 

try{

ExcelApp = new ActiveXObject("Excel.Application");
ExcelApp.Application.Visible = false;
ExcelBook = ExcelApp.Workbooks.Open(file_str); //打開工作簿
ExcelSheet = ExcelBook.Sheets(1); //取第一個工作表

}

catch(e)
{
alert(e.message + e.description);
alert("打开Excel表失败,请尝试把站点添加为信任站点!");
 alert(e.description)
// alert(e.number)
// alert(e.name)

return false ;
}

用这种方法的时候,需要对浏览器作一些设置,我出现过一个错误是,上传excel 文件的时候路径不是本机的正常路径而出错,注意捕获错误。

分类:

技术点:

相关文章:

  • 2021-09-08
  • 2021-09-08
  • 2021-09-08
  • 2021-11-23
  • 2021-09-08
  • 2021-12-19
猜你喜欢
  • 2021-11-21
  • 2021-09-08
  • 2021-09-08
  • 2021-06-14
相关资源
相似解决方案