Solved

Load value from Excel spreadsheet to ASP page

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to dynamically set the form action using jQuery.

707 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