473,385 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Update an existing Excel file using ASP - Urgent

3
Hi Everyone,

I have an Excel file to update on-line using ASP. I could write data to a fresh excel file. But I couldn't find a way to open an existing Excel file and update relevant cells. If any one know a clue about this Pl. give me a hint.
Mar 21 '07 #1
5 10298
sani723
117 100+
Check this, may be helpful 4 u http://www.dotnetspider.com/qa/Question534.aspx
Mar 21 '07 #2
Aspgm
3
Dear Sani
Thank U for prompt reply. But I am looking for a solution for ASP and not for ASP.NET.
Mar 21 '07 #3
sani723
117 100+
then this can help you http://support.microsoft.com/default.aspx/kb/195951
Mar 21 '07 #4
jhardman
3,406 Expert 2GB
Dear Sani
Thank U for prompt reply. But I am looking for a solution for ASP and not for ASP.NET.
I do this all the time using ado; there is an excel db driver. This requires that the worksheet you update is set up as a db (the other sheets can be in any format you want). Here is an example I worked up and posted several weeks ago. It updates data in a worksheet called "data" in a file called "graphAspTest.xls" then redirects the user to the excel file. Let me know if it helps.
Expand|Select|Wrap|Line Numbers
  1. <% option explicit %>
  2. <!-- #include virtual="common/adovbs.inc" -->
  3. <%
  4. dim objConn, objRS, query, file, names(5), hours(5), i
  5.  
  6. names(0) = "George"
  7. names(1) = "Freeda"
  8. names(2) = "Hercules"
  9. names(3) = "Agatha"
  10. names(4) = "Francois"
  11. hours(0) = 17
  12. hours(1) = 25
  13. hours(2) = 40
  14. hours(3) = 12
  15. hours(4) = 36
  16.  
  17. file = "graphAspTest.xls"
  18. set objConn = server.createobject("ADODB.connection")
  19. objConn.open "Provider = Microsoft.Jet.OLEDB.4.0;Data Source="&_
  20.    server.mapPath(File)&"; Extended Properties=Excel 8.0;"
  21.  
  22. query = "SELECT * FROM [data$]"
  23. query = query & " ORDER BY nums"
  24. set objRS = server.createobject("adodb.recordset")
  25. objRS.open query, objConn, adopenDynamic, adlockOptimistic
  26.  
  27. for i = 0 to 4
  28.    objRS("names") = names(i)
  29.    objRS("hoursWorked") = hours(i)
  30.    objRS.update
  31.    objRS.movenext
  32. next
  33.  
  34. objRS.close
  35. objConn.close
  36. response.redirect "graphAspTest.xls"
  37. %>
Jared
Mar 22 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: cv | last post by:
Hi all, I have to copy two set of data from 2 files(notepad/excel) say, products and their corresponding prices to list/textarea/table. I should be able to retrieve the product and corresponding...
12
by: jimserac | last post by:
I had previously posted this in an Access forum with negative results so will try here. Although this question specifies an Access database, I also wish to accomplish this with a large MS SQL...
2
by: Anne Sachleben via AccessMonster.com | last post by:
I am using the TransferSpreadsheet function to export a query result to a specific worksheet in an Excel file titled "report". I want the result to be exported to the worksheet titled "facts". ...
3
by: wildbill | last post by:
I have an Excel spreadsheet with 1000+ rows that I need to import into an Access 2002 db once a month or so. I then need to use that information to update any existing records(multiple fields may...
3
by: nikila | last post by:
Hi, I have to create excel pivot tables from vb.net. Already I am creating excel file using oledb connection. I want to use the same to create the excel pivot tables. Can anyone please help me...
3
by: Roy | last post by:
Hi Access gurus, I have a A2K application.The data in the database is updated daily by a excel download.I have a master n related tables keyed in by a OrderID.I have a problem in updating data.If...
1
by: egrill | last post by:
I have an Excel file that needs to be updated nightly and sent to a user. I can't find anyway using the existing marcos that would allow me to set a automated command to run the query on a scheduled...
5
by: tsanthoshk | last post by:
Hi All I am trying to read and modify input excel file. when i update the data in excel sheet already existing format is washing out. It mean if excel sheet contain colors those are not appearing...
13
by: Peter | last post by:
VS2008 ans ASP.NET 3.5, Office 2003 What is the best way to run Excel Template from ASP.NET web page were the Excel is only installed on the client without any ActiveX? If so can someone point...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.