Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Load value from Excel spreadsheet to ASP page

Posted on 2004-10-19
3
Medium Priority
?
324 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 800 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 1200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
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…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

927 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