Solved

Load value from Excel spreadsheet to ASP page

Posted on 2004-10-19
3
284 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
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 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)

773 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