使用该VBScript中的客户端的出口。请记住,您需要允许在浏览器设置中运行activex控件。
<script language="vbscript">
Function Export(objToExport)
ON ERROR RESUME NEXT
DIM sHTML, oExcel, fso, filePath
sHTML = document.all(objToExport).outerHTML
SET fso = CreateObject("Scripting.FileSystemObject")
filePath = fso.GetSpecialFolder(2) & "\MyExportedExcel.xls"
fso.CreateTextFile(filePath).Write(sHTML)
DIM i
SET i = 0
DO WHILE err.number > 0
err.Clear()
filePath = fso.GetSpecialFolder(2) & "\MyExportedExcel" & i & ".xls"
i = i + 1
LOOP
SET oExcel = CreateObject("Excel.Application")
IF err.number>0 OR oExcel = NULL THEN
msgbox("You need to have Excel Installed and Active-X Components Enabled on your System.")
Exit Function
END IF
oExcel.Workbooks.open(filePath)
oExcel.Workbooks(1).WorkSheets(1).Name = "My Excel Data"
oExcel.Visible = true
Set fso = Nothing
End Function
如要求对这个问题 – 2012-03-14 11:33:10
我提出的替代解决方案的作者,因为我出口XSL没有一个准确的答案在网页上这个插件导出到逗号分隔值,而不是为Excel文件。 你有问题的答案吗? – 2012-03-14 12:08:54