473,320 Members | 2,177 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Cannot access Excel sheet data from Visual Basic.Net

Hi Developers,

I am trying to access an Excel data file through a VB.Net application.
I have the following code:

=================================== VB.Net Code ===================
Dim sSqlString = ""
Dim rCount As Integer = 0
Dim sDataSet As New DataSet()
sSqlString = "Select * From [Sheet1$]"
Dim sConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + "E:\Visual Basic.NET\DataOne" + ";Extended Properties=Excel 8.0;HDR=YES;"
Dim dbConn As New OleDbConnection(sConnString)
Dim sCommandSelect As New OleDbCommand(sSqlString, dbConn)

Try
sCommandSelect.Connection.Open()
Catch ex As OleDbException
MessageBox.Show(ex.Message, ex.ErrorCode)
End Try
================================================== =======

Each time I hit the statement "sCommandSelect.Connection.Open()" above, I got the following error:

"Could not find installable ISAM"

Excel 2002 and Visual Studio.Net are both fully and successfully installed.
Anyone knows why it would not make work?

Sincerely,
Omar
P.S. Please cc your reply to my email: oy****@yahoo.com

Nov 20 '05 #1
3 2932
Hi,

You get that error if when ado.net is unable to open the data
source. Shouldn't your data source be something like this "E:\Visual
Basic.NET\DataOne.xls" + "; not "E:\Visual Basic.NET\DataOne" + ";

Ken
-------------------------------

"Omar" <oy****@yahoo.com> wrote in message
news:F4**********************************@microsof t.com...
Hi Developers,

I am trying to access an Excel data file through a VB.Net application.
I have the following code:

=================================== VB.Net Code ===================
Dim sSqlString = ""
Dim rCount As Integer = 0
Dim sDataSet As New DataSet()
sSqlString = "Select * From [Sheet1$]"
Dim sConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + "E:\Visual Basic.NET\DataOne" + ";Extended Properties=Excel
8.0;HDR=YES;" Dim dbConn As New OleDbConnection(sConnString)
Dim sCommandSelect As New OleDbCommand(sSqlString, dbConn)

Try
sCommandSelect.Connection.Open()
Catch ex As OleDbException
MessageBox.Show(ex.Message, ex.ErrorCode)
End Try
================================================== =======

Each time I hit the statement "sCommandSelect.Connection.Open()" above, I got the following error:
"Could not find installable ISAM"

Excel 2002 and Visual Studio.Net are both fully and successfully installed. Anyone knows why it would not make work?

Sincerely,
Omar
P.S. Please cc your reply to my email: oy****@yahoo.com

Nov 20 '05 #2
i don't know
-----Original Message-----
Hi,

You get that error if when ado.net is unable to open the datasource. Shouldn't your data source be something like this "E:\VisualBasic.NET\DataOne.xls" + "; not "E:\Visual Basic.NET\DataOne" + ";
Ken
-------------------------------

"Omar" <oy****@yahoo.com> wrote in message
news:F4E4E2D8-CB27-44E2-90FB- 5C**********@microsoft.com...
Hi Developers,

I am trying to access an Excel data file through a VB.Net application. I have the following code:

=================================== VB.Net Code =================== Dim sSqlString = ""
Dim rCount As Integer = 0
Dim sDataSet As New DataSet()
sSqlString = "Select * From [Sheet1$]"
Dim sConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=" + "E:\Visual Basic.NET\DataOne" + ";Extended Properties=Excel8.0;HDR=YES;"
Dim dbConn As New OleDbConnection
(sConnString) Dim sCommandSelect As New OleDbCommand (sSqlString, dbConn)
Try
sCommandSelect.Connection.Open()
Catch ex As OleDbException
MessageBox.Show(ex.Message, ex.ErrorCode)
End Try
============================================
=============
Each time I hit the statement "sCommandSelect.Connection.Open()" above, Igot the following error:

"Could not find installable ISAM"

Excel 2002 and Visual Studio.Net are both fully and
successfullyinstalled.
Anyone knows why it would not make work?

Sincerely,
Omar
P.S. Please cc your reply to my email:

oy****@yahoo.com

.

Nov 20 '05 #3
On Thu, 23 Oct 2003 23:21:05 -0700, "Omar" <oy****@yahoo.com> wrote:

¤ Hi Developers,
¤
¤ I am trying to access an Excel data file through a VB.Net application.
¤ I have the following code:
¤
¤ =================================== VB.Net Code ===================
¤ Dim sSqlString = ""
¤ Dim rCount As Integer = 0
¤ Dim sDataSet As New DataSet()
¤ sSqlString = "Select * From [Sheet1$]"
¤ Dim sConnString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + "E:\Visual Basic.NET\DataOne" + ";Extended Properties=Excel 8.0;HDR=YES;"
¤ Dim dbConn As New OleDbConnection(sConnString)
¤ Dim sCommandSelect As New OleDbCommand(sSqlString, dbConn)
¤
¤ Try
¤ sCommandSelect.Connection.Open()
¤ Catch ex As OleDbException
¤ MessageBox.Show(ex.Message, ex.ErrorCode)
¤ End Try
¤ ================================================== =======
¤
¤ Each time I hit the statement "sCommandSelect.Connection.Open()" above, I got the following error:
¤
¤ "Could not find installable ISAM"
¤
¤ Excel 2002 and Visual Studio.Net are both fully and successfully installed.
¤ Anyone knows why it would not make work?

Your connection string syntax is bad. It gets a little tricky when you have additional Extented
Properties and you also need to specify the Excel filename:

"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=E:\Visual Basic.NET\DataOne\ExcelFileName.xls;" & _
"Extended Properties=""Excel 8.0;HDR=Yes"""
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

41
by: Ruby Tuesday | last post by:
Hi, I was wondering if expert can give me some lite to convert my word table into access database. Note: within each cell of my word table(s), some has multi-line data in it. In addition, there...
4
by: Anthony Cuttitta Jr. | last post by:
I'm working on some procedures where Access queries are exported to Excel, and then later on, those same workbooks are openned, and I need to target a specific original sheet. Sometimes there will...
3
by: Mads Petersen | last post by:
I'm stuck in this code. Hope you can and will help me. I launch it from excel. I have made the following code work, but not as i whant. I need the ranges to be working with something like xlDown....
1
by: http://www.visual-basic-data-mining.net/forum | last post by:
I have a web form in which I have a datagrid, I need to export this data to a Microsoft Excel sheet. I'm doing it thus: Response.Clear();
12
by: elziko | last post by:
I'm using late binding (I must) to automate Excel. My code opens Excel after createing and poulating some sheets. My problem is that when the user finally decides to close Excel its process is...
5
by: mark | last post by:
I've been looking at working with Excel data. I understand the process of getting the data into a dataset and modifying it. It's one of simple beauty that is well documented. Now, I want to send...
3
by: Nashwa24 | last post by:
Hi all, I'm a newbie in Access and really need help. I need to do some calculations on data stored in a database's table. Previously I used to store the data in an excel sheet and run a visual...
1
by: nithya jayaraman | last post by:
hi now i am using vb with MS Access ... but i have some information in excel wook sheet , so access that data and store to data grid then find out the average of the sheet 1 and sheet 2 and...
7
by: kpresidente | last post by:
Hello all, I'm trying to transfer the value of a control on an Access form to an Excel worksheet using VBA. The Access form is a single form with all the controls disabled, so that data is "read...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.