请教,在 ASP 网页中用 VBS 操作 excel
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<script language="vbscript">
sub OPenExcelFile()
set objExcelApp = CreateObject("Excel.Application")
objExcelApp.DisplayAlerts = false
objExcelApp.Application = false
objExcelApp.WorkBooks.add
set objExcelBook = objExcelApp.ActiveWorkBook
set objExcelSheets = objExcelBook.Worksheets
set objExcelSheet = objExcelBook.Sheets(1)
strAddr = Server.MapPath(".")
objExcelApp.WorkBooks.Open(strAddr & "TempletTable.xls")
set objExcelBook = objExcelApp.ActiveWorkBook
set objExcelSheets = objExcelBook.Worksheets
set objExcelSheet = objExcelBook.WorkSheets(1)
objExcelBook.Save
objExcelApp.Quit
set objExcelApp = nothing
End sub
</script>
<body>
<form id="form1" name="form1" method="post" action="">
<input type="submit" name="Submit" onclick="OPenExcelFile" value="打印" />
</form>
</body>
</html>
如以上代码想创建一个excel文件,但是创建失败,求教代码哪里错了,如何修改?