excel| Insert | page <%
Set xlapp = Server.CreateObject ("Excel.Application")
' Make the service side does not appear excel windows
Xlapp.visible = False
' Build a worksheet
Set MyWorkbook = XlApp.Workbooks.Add
Set myworksheet = Myworkbook.worksheets (1)
' Set the head of the table
Myworksheet.range ("A1"). Value = ' phone book '
Myworksheet.range ("A1"). Font.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 '
Myworksheet.range ("A2:d2"). Font.Bold = True
' Make sure the filename is unique
strFileName = Session.SessionID & ". xls"
Strapppath = Request.ServerVariables ("path_translated")
Strapppath = Left (Strapppath, InStrRev (Strapppath, "\"))
strFullPath = Strapppath & strFileName
' Save file
Myworkbook.saveas (strFullPath)
' Close Excel
Myworkbook.close
xlApp.Quit
Set Myworksheet = Nothing
Set MyWorkbook = Nothing
Set Myxlapp = Nothing
' Write to the browser
Response.Redirect strFileName
%>