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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error when attempting to read an Excel file with VB.Net

Status
Not open for further replies.

Jabez3rd

Programmer
Feb 6, 2003
9
US
I'm attempting to create an ASP.Net application (using a
VB.Net code behind page)process that creates a connection
to an Excel spreadsheet and reads the contents of the
spreadsheet.

However,when the command is executed to open the
connection (cnnExcel.Open()) , I receive the following error:
"Could Not Find Installable ISAM"

When I use ""Excel 8.0;... I receive the error
"Failure Creating File"

The code I am executing appears below:

Public Sub importProviderExcelFiles()

Dim m_sConnection As String
="Provider=Microsoft.Jet.OleDB.4.0;" & _
"Data Source=E:\CESpreadsheet.xls;" & _
"Extended Properties=""Excel 9.0;HDR=YES"""

Dim cnnExcel As New System.Data.OleDb.OleDbConnection
(m_sConnection)
cnnExcel.Open()

Dim cmdExcel As New System.Data.OleDb.OleDbCommand
("Select * From [Sheet1$]", cnnExcel)
Dim excelDataReader As OleDbDataReader =
cmdExcel.ExecuteReader
Do While excelDataReader.Read
excelDataReader.GetString(0)
Loop

excelDataReader.Close()
cnnExcel.Close()

Any assistance will be greatly appreciated!

Thanks.

Brian

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top