<%
Set xlapp = server. Createobject ("Excel. application ")
Xlapp. Visible = false
'Disable ServerExcelWindow.
Set myworkbook = xlapp. workbooks. Add
' Create Worksheet.
Set myworksheet = myworkbook. worksheets (1)
Myworksheet. Range ("A1"). value =' Brilliant spring breeze address book '
Myworksheet. Range ("A1"). Font. size = 12
Myworksheet. Range ("A1"). Font. Bold = true
Myworksheet. Range ("A2"). value =' Name '
Myworksheet. Range ("B2"). value =' Address '
Myworksheet. Range ("C2"). value =' Phone number '
Myworksheet. Range ("D2"). value =' Mobile phone '
'Above7Create a header for a row.
Myworksheet. Range ("A2: D2"). Font. Bold = true
Strfilename = session. sessionid & ". xls"
'Ensure the file name is unique.
Strapppath = request. servervariables ("path_translated ")
Strapppath = left (strapppath, limit Rev (strapppath ,"\"))
Strfullpath = strapppath & strfilename
Myworkbook. saveas (strfullpath)
'Save files.
Myworkbook. Close
'CloseExcel.
Xlapp. Quit
Set myworksheet = nothing
Set myworkbook = nothing
Set myxlapp = nothing
Response. Redirect strfilename
' Write ASP Page , In the browser .
%>
[1]