Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Excel - Newbie To ASP

Status
Not open for further replies.

crusader

Programmer
Apr 26, 2001
24
GB
Hi,

How do you update an existing excel sheet?
Is it possible with out using ADO.

The excel sheet already has headings, I wish to populate the spreadsheet with data from a HTML form.

Crusader
 
Where are you storing the data from the HTML form? Or are you wanting to post directly to Excel? If you want to post directly to an existing spreadsheet, do you plan on appending or over-writing?

Krickles | 1.6180

 
Hi Krickles,

Thanks for the reply, in answer to your question I'm trying to post form data into an Excel sheet, and appending under a row of column headings.

Thanks,
Crusader
 
a csv file, yes, using FSO, but excel has binary data at the beginning, column widths, functions, etc, you'll need to use ado to update it

[thumbsup2]DreX
aKa - Robert
 
Thanks DreXor,

I found that this works:

dim fsoObj, sFileName, objtextFile, fieldName, fieldValue
sFileName = server.MapPath("test.csv")
set fsoObj = Server.CreateObject("Scripting.FileSystemObject")
set objtextFile = fsoObj.OpenTextFile(sFileName, 8)
For ix = 1 to Request.Form.Count
fieldName = Request.Form.Key(ix)
fieldValue = fieldValue&Request.Form.Item(ix)&","
Next
objTextFile.WriteLine(fieldValue)
objTextFile.Close
set objTextFile = nothing
set fsoObj = nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top