Excel.Workbooks.Open方法中的问题 [英] Problem in Excel.Workbooks.Open method

查看:1469
本文介绍了Excel.Workbooks.Open方法中的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

var Excel;
    Excel = new ActiveXObject("Excel.Application");
    Excel.Visible = false;
    alert(Excel.Workbooks.Open("C:/it_ideclr.xls").ActiveSheet.Cells(1,1).Value);
    Excel.Quit();



通过功能调用上述代码时,即使文件位于该位置,文件也不存在消息会出现



When calling the above code via a fynction, file doesn''t exist message comes even though the file exists in that location

推荐答案

请确保文件不是Locked
您的M/C内部安装了MS Excel(打开excel时出现此问题)
Make sure file is not Locked or
you have MS Excel installed inside you M/C ( I was having this problem while opening excel)


var Excel;
    Excel = new ActiveXObject("Excel.Application");
    Excel.Visible = false;
    alert(Excel.Workbooks.Open("C:/it_ideclr.xls").ActiveSheet.Cells(1,1).Value);
    Excel.Quit();



不确定,但是您的路径应该不是("C:\ it_ideclr.xls")吗?
检查workbook.open是否支持所有类型的路径分隔符.



Not sure about this, but should your path not be ("C:\it_ideclr.xls")?
Check if workbook.open supports all type of path separators.


这篇关于Excel.Workbooks.Open方法中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆