Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

import an excel file to access dbase using ASP? 2

Status
Not open for further replies.

daveigh

Programmer
Oct 9, 2003
105
hi all, does anybody hav a link or knows a way how to import an excel file to access dbase using ASP? ive been searching in google & im not satisfied with the results..any code snippet is very much appreciated. tnx!

_______________CRYOcoustic_____________
 
This could help
Code:
Dim objXlApp, objXlSheet

' create the Excel object
Set objXlApp = Server.CreateObject("Excel.Application")

' open the spreadsheet file
objXlApp.Workbooks.Open Server.MapPath("excelfile.xls")

' get the worksheet
Set objXlSheet = objXlApp.Worksheets("Sheet1")

' read from the worksheet
Response.Write(objXlSheet.Range("B1").Text)

' clean up
Set objXlSheet = Nothing
objXlApp.Workbooks.Close
Set objXlApp = Nothing
If you are familiar with VBA fro Excel then this is what you would need.
Or ODBC way


________
George, M
 
Found this post through a google search and it is exactly what I was looking for. I ran the code though and got this error message:

Server object error 'ASP 0196 : 80040154'

Cannot launch out of process component

/TestExcel.asp, line 5

Only InProc server components should be used. If you want to use LocalServer components, you must set the AspAllowOutOfProcComponents metabase setting. Please consult the help file for important considerations.

Any suggestions on how to get this to run?? Thanks a bunch
 
Hi iam also looking for something like this can you please let me know the result please give me a sample code for this , thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top