472,352 Members | 1,434 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,352 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 10170
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...
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...
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...
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...
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...
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...
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...
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...
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...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.