ASP向浏览器写入一个 Excel 文件
From MSDN:
<%
'Set the content type to the specific type that you are sending.
Response.ContentType = "application/x-msexcel"
Const adTypeBinary = 1
Dim strFilePath
strFilePath = "C:\ExcelFiles\Excel1.xls" 'This is the path to the file on disk.
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFilePath
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing
%>
浙公网安备 33010602011771号