Insert | page execel file insert to ASP page <%
Set xlapp=server.createobject ("Execel.application")
Xlapp.visible=false
' Make the server not appear execel window
Set Myworkbook=xlapp. Wordbooks.add
Set myworksheet=myworkbook.worksheets (1)
' Build a worksheet
Myworksheet.range ("A1"). Value= '
Myworksheet.range ("A1"). Vont.size=18
Myworksheet.range ("A1"). Font.bold=true
Myworksheet.range ("A2"). Value= ' name '
Myworksheet.range ("B2"). Value= ' Address '
Myworksheet.range ("C2"). Value= ' phone '
Myworksheet.range ("D2"). Value= ' Fax '
' Set the head of the table
Myworksheet.range ("A2:d2"). Font.bold=true
strfilename=session.sessionid& ". xls"
' Make sure the filename is unique
Strapppath=request.servervariables ("path_translated")
Strapppath=left (Strapppth,instrrev (Strapppath, "\"))
Strfullpath=strapppath&strfilename
Myworkbook.saveas (strFullPath)
' Save file
Myworkbook.close
' Close Excel
xlApp.Quit
Set myworksheet=nothing
Set myworkbook=nothing
Set myxlapp=nothing
Response.Redirect strFileName
' Send it to the browser.
%>