求助:javascript操作owc的问题

jdsnhan 2012-06-19 10:39:09
在javascript中操作owc,赋值,展示都没问题,到最后导出为excel文件时,并非按帮助说中的,导出指定文件名的文件。

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>


<input type="button" value="导出" onclick="exp()">
<OBJECT classid=clsid:0002E551-0000-0000-C000-000000000046 id=Spreadsheet1 style="width:100%;HEIGHT:95%">
</OBJECT>
</HTML>

<script>
Spreadsheet1.activesheet.range("a1").value = "水泥产量";
Spreadsheet1.activesheet.range("a2").value = 1;
Spreadsheet1.activesheet.range("b2").value = 2;
Spreadsheet1.activesheet.range("b3").value = 3;

function exp(){
Spreadsheet1.Export("d:\\a.xls");
}
</script>


附,MSDN的帮助说明:
expression.Export(Filename, Action, Format)

expression An expression that returns a Spreadsheet object.

Filename Optional String. Specifies the file name of the saved file. If you do not specify this argument, a temporary file is created in the user's temporary folder (the location of the temporary folder varies by operating system). You must specify this argument if the Action argument is set to ssExportActionNone.
...全文
216 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
jdsnhan 2012-06-19
  • 打赏
  • 举报
回复
win7,office2007 环境下,提示内容为:

该程序试图将"/c:/d:/a.xls" 保存到硬盘上。等等。无法导出
jdsnhan 2012-06-19
  • 打赏
  • 举报
回复
提示错误

win7,office2007 环境下,提示内容为:

该程序试图将"/c:/d:/a.xls" 保存到硬盘上。等等。
风一样的大叔 2012-06-19
  • 打赏
  • 举报
回复
哪边有问题了?

87,996

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧