vbscript写的script,在本地可以执行,写入asp就不能用了?
我写了一个打开excel的script:
<html>
<head>
<script language="VBscript">
Dim xlApp,xlBook,xlSheet
Dim i,j
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.add
Set xlSheet = xlBook.Worksheets(1)
xlSheet.Cells(1,1).Value = "1"
xlApp.Visible=true
xlSheet.Close
xlBook.Close
xlApp.Close
set xlSheet = Nothing
set xlBook = Nothing
set xlApp = Nothing
</script>
</head>
<body>
</body>
</html>
在本地就可以用(虽然会弹出提示说不安全),但是如果把这个文件发去网上,根本就无法执行,有时候会提示说“activex 部件不能创建对象 Excel.Application”,有时候(比如再刷新一次)完全没提示
我查了一下这个提示,有人说是因为网上服务器的机器里面没装Excel,不过我觉得奇怪,既然完全是html代码,不是在本地执行的么?