var Excel = new ActiveXObject("Excel.Application");
Excel.Visible=true;
Excel.WorkBooks.Open("file:\\\C:/temp/aaa.xls");aaa.xls在正常情况下能打开,但当他待一个自动运行的宏的时候,就不能正常打开,没有任何提示。
Excel.Visible=true;
Excel.WorkBooks.Open("file:\\\C:/temp/aaa.xls");aaa.xls在正常情况下能打开,但当他待一个自动运行的宏的时候,就不能正常打开,没有任何提示。
var xlApp, xlSheet;
xlApp = new ActiveXObject("Excel.Application");
xlApp.Visible = true;
xlApp.Workbooks.Add();
xlApp.Workbooks.Open("C:\\book2.xls");
</script>
</HTML>
wsh.run("explorer c:\\xxx.xls")
第一种方法提示路径不对,加上file:\\\可以用,但宏不能运行。
第二种方法不行,因为我想用新窗口打开该文件,window.open()好像不能用来打开本地文件。
第三种请你写的详细一点好吗?我查了msdn,上面wsh有好多对象,不知道你的wsh是什么对象。
多谢了!
—————————————————————————————————
想我所想 做我所做 156838384 ^-^
Set wShell =CreateObject("WScript.Shell")
wShell.Run "C:\XXX.xsl"
Set wShell =Nothing
</SCRIPT>
<script language=vbscript>
Set fso =CreateObject("Scripting.FileSystemObject")
Set oFile =fso.OpenTextFile("X:\xxx.xls")
While Not AtEndOfStream
result =oFile.ReadLine
document.Write (result+"<br>")
WEnd
Set fso =Nothing
</script>
那上面的也不对了~ :>
该用ADO数据库链接就可以了.
上面的若干方法,都是受这个限制..要么提示下载,要么提示不安全...从浏览器安全性设计方面就决定了这一点..
Set fso =CreateObject("Scripting.FileSystemObject")
Set oFile =fso.OpenTextFile("X:\xxx.xls")wsh = new ActiveXObject("wscript.shell");
wsh.run("your filepath");WshShell.Exec()在msdn上有example吧