HOW TO: Create a .xls file on the server. Not for

Results 1 to 2 of 2

Thread: HOW TO: Create a .xls file on the server. Not for

  1. #1
    PJ Guest

    Default HOW TO: Create a .xls file on the server. Not for

    Hi,<BR>I would like to take some input from a form and just output it to a file in a directory on the server where it can be picked up by a customer service person. The file needs to be in .xls format.<BR>I don&#039t need to actually display an Excel worksheet on a webpage (as in all the examples I have found on the web), just dump the form contents out into a file.<BR>I tried creating an Excel object in vbscript etc but seem to only break IIS. So I&#039m obviously doing something wrong...could anyone point me at a working example that can create a new .xls file, put some data in a few cells and then save and close the file?<BR>Thanks in advance<BR>PJ<BR>

  2. #2
    PJ Mealy Guest

    Default RE: HOW TO: Create a .xls file on the server. Not

    Ok, I&#039ll reply to my own message in case anyone needs to do this again:<BR>I got the following code to work. Seems to be fine. I would welcome any comments about how heavy this would be in terms of server load etc...<BR>&#060;%<BR> <BR> &#039make the Sheet<BR> <BR>Dim ExcelFace<BR>Set ExcelFace = CreateObject("Excel.Sheet")<BR><BR>&#039Don&#039t display anything to the user<BR><BR>ExcelFace.Application.Visible = False<BR><BR>&#039 Write the text<BR>ExcelFace.ActiveSheet.Cells(1,1).Value = "You now have text in a cell"<BR><BR>&#039 Save the the excelsheet to excelface<BR>ExcelFace.SaveAs "c: empsqueezeout.xls"<BR>&#039 Close Excel with the Quit method on the Application object.<BR>ExcelFace.Application.Quit<BR>&#039 Release the object variable.<BR>Set ExcelFace = Nothing <BR><BR> %&#062;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts