dbWriter open a file in Excel ASP code
Note!!! Excel must be loaded on your pc for this to work!!
Click here to test Excel open
<%
'Set the content type to the specific type that you are sending.
Response.ContentType = "application/vnd.ms-excel"
Const adTypeBinary = 1
Dim strFilePath
strFilePath = Server.MapPath("\YourPath\YourFile.xls")
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFilePath
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing
%>
|
|