[quote]var oXL = new ActiveXObject("Excel.Application");
var oWB = oXL.Workbooks.open("D://autoRead//excel//sbqc.xls");
oWB.worksheets(1).select();
var oSheet = oWB.ActiveSheet;
var colcount=oWB.Worksheets(1).UsedRange.Cells.Rows.Count;
var colcolumn=oWB.Worksheets(1).UsedRange.Columns.Count;
try
{
for (var j=1;j<=colcount;j++)
{
for (var i=1;i<=colcolumn;i++)
{
document.write(oSheet.Cells(j,i).value + ",");
}
document.write("<br/>");
}
}
catch(e)
{
oWB.close();
}
oWB.close(); [/quote]
如果导入脚本不能用,可能是open()方法的地址有问题。在地址没问题的情况 测试可用
转自:http://blog.csdn.net/simplebg/article/details/5964734
var oWB = oXL.Workbooks.open("D://autoRead//excel//sbqc.xls");
oWB.worksheets(1).select();
var oSheet = oWB.ActiveSheet;
var colcount=oWB.Worksheets(1).UsedRange.Cells.Rows.Count;
var colcolumn=oWB.Worksheets(1).UsedRange.Columns.Count;
try
{
for (var j=1;j<=colcount;j++)
{
for (var i=1;i<=colcolumn;i++)
{
document.write(oSheet.Cells(j,i).value + ",");
}
document.write("<br/>");
}
}
catch(e)
{
oWB.close();
}
oWB.close(); [/quote]
如果导入脚本不能用,可能是open()方法的地址有问题。在地址没问题的情况 测试可用
转自:http://blog.csdn.net/simplebg/article/details/5964734