- 426 名前:nobodyさん mailto:sage [2006/04/10(月) 23:13:55 ID:???]
- 自分のPCにExcel入ってないから試せないんだがこんな感じかなぁ
<% Sub Exl Dim ExcelApp, ExlFile, Filename, bobj ,b Set ExcelApp = Server.CreateObject("Excel.Application") ExcelApp.visible = True ExlFile="D:/asp/files/temp.xls" Filename="temp.xls" ExcelApp.DisplayAlerts = False ExcelApp.Workbooks.open(ExlFile) ExcelApp.Sheets("page1").Select ExcelApp.ActiveSheet.Range("A1").value= Year(Now()) & " 年 " ExcelApp.ActiveSheet.PrintPreview Excelapp.Quit Set ExcelApp = Nothing Response.ContentType = "application/octet-stream;name=" & Filename Response.AddHeader "Content-Disposition","attachment;filename=" & Filename Set bobj = Server.CreateObject("BASP21") b = bobj.BinaryRead(ExlFile) Set bobj = Nothing Response.AddHeader "Content-Length", ubound(b) + 1 Response.BinaryWrite bydata End Sub %>
|

|