Solved

Load value from Excel spreadsheet to ASP page

Posted on 2004-10-19
3
280 Views
Last Modified: 2010-04-06
I have an excel spreadsheet on the server and would like to view the information on a page using classic ASP.

Any suggestions on how to code this?  Thanks in Advance...
0
Comment
Question by:sl1nger
3 Comments
 
LVL 4

Assisted Solution

by:erichranz
erichranz earned 200 total points
ID: 12350506
This is a great source of info: http://algonquinstudios.com/article_215.html
0
 

Author Comment

by:sl1nger
ID: 12371344
That looks like the correct example, but now I have a problem importing the data back into excel

- Microsoft JET Database Engine: The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data.  

I know that the field length is greater than 255 characters, but the information was previously in excel.  I think as a text wrap.

Have you seen this before?
0
 
LVL 2

Accepted Solution

by:
JuergenHartl earned 300 total points
ID: 12393243
do not us the excel ODBC driver, but use excel itself to deliver the data. Why ? ODBC only works on DB like worksheets but not on gerneric worksheets!
here is a routine to read data from an excel worksheet:

dim fname ' excel filename
dim sh_name ' name of sheet to use
dim ex, sh, wb
dim r ' cell to retieve
fname="f:\demodata\book1.xls" ' **** adjust here
sh_name="sheet 1"                   ' **** adjust here
r="a1"                                      ' **** adjust here
set ex=server.CreateObject("Excel.Application")
set wb = ex.Workbooks.Open(f_name, , True)
wb.sheets(sh_name).activate       ' activate the sheet
set sh=wb.activesheet                
response.write sh.range(r).value  ' get a value
wb.close false                             ' close workbook without saving
ex.Quit                                       ' quit excel

you could write data back in a similar manner.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now