473,574 Members | 3,202 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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=Micro soft.Jet.OLEDB. 4.0;Data Source=" + "E:\Visual Basic.NET\DataO ne" + ";Extended Properties=Exce l 8.0;HDR=YES;"
Dim dbConn As New OleDbConnection (sConnString)
Dim sCommandSelect As New OleDbCommand(sS qlString, 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.Ope n()" 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.co m

Nov 20 '05 #1
3 2952
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\DataO ne.xls" + "; not "E:\Visual Basic.NET\DataO ne" + ";

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

"Omar" <oy****@yahoo.c om> wrote in message
news:F4******** *************** ***********@mic rosoft.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=Micro soft.Jet.OLEDB. 4.0;Data Source=" + "E:\Visual Basic.NET\DataO ne" + ";Extended Properties=Exce l
8.0;HDR=YES;" Dim dbConn As New OleDbConnection (sConnString)
Dim sCommandSelect As New OleDbCommand(sS qlString, 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.Ope n()" 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.co m

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\Data One.xls" + "; not "E:\Visual Basic.NET\DataO ne" + ";
Ken
-------------------------------

"Omar" <oy****@yahoo.c om> wrote in message
news:F4E4E2D 8-CB27-44E2-90FB- 5C**********@mi crosoft.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=Micro soft.Jet.OLEDB. 4.0;DataSource=" + "E:\Visual Basic.NET\DataO ne" + ";Extended Properties=Exce l8.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.Ope n()" 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.co m

.

Nov 20 '05 #3
On Thu, 23 Oct 2003 23:21:05 -0700, "Omar" <oy****@yahoo.c om> 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=Micro soft.Jet.OLEDB. 4.0;Data Source=" + "E:\Visual Basic.NET\DataO ne" + ";Extended Properties=Exce l 8.0;HDR=YES;"
¤ Dim dbConn As New OleDbConnection (sConnString)
¤ Dim sCommandSelect As New OleDbCommand(sS qlString, 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.Ope n()" 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=Micro soft.Jet.OLEDB. 4.0;" & _
"Data Source=E:\Visua l Basic.NET\DataO ne\ExcelFileNam e.xls;" & _
"Extended Properties=""Ex cel 8.0;HDR=Yes"""
Paul ~~~ pc******@amerit ech.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
6070
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 is one row containing picture(s) as well. So far, what I did is doing it manually for each word docs I have. Select Table Convert Table to...
4
3404
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 be multiple sheets in the same workbook, sometimes only a single tab. The issue is this: Save query "XLTest - qryExport" to file and the...
3
25034
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. eg. this only transferes the first record in the area. ..Fields("Uge").Value = ws.Range("A98").Value Sub SelectMaster()
1
1452
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
3212
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 left running until my application closes. I have tried setting my Excel.Application object to Nothing. I have tried to then fore the GC into...
5
4735
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 the updated data set back. I suspect this is also simple but it eludes me. I have: Private Sub Button3_Click(ByVal sender As System.Object, ByVal...
3
1318
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 basic macro on them which made some calculations and added new columns for the results in the excel sheet. I could select a specific cell and use its...
1
1771
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 finaly store result in sheet 3 like this data stored in sheet 1 have cell name A1:A10 call Name B1:B10 Sheet 2 have
7
13158
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 only." I have a button on the form which opens the Excel worksheet, which then basically serves as the input form for the Access database. What I...
0
7843
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7764
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8274
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7863
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6514
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2282
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1375
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1102
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.