Click here to Skip to main content
15,889,931 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Guys help me. I need to export the excel file to datagridview. But Everytime i select opened the file via file dialog box, the error was come and says "COULD NOT FIND INSTALLABLE ISAM" Help me please. With using Microsoft.Jet.OLEDB.4.0 not the Microsoft.ACE.OLEDB.12.0. Thanks

What I have tried:

VB
Dim OpenFileDialog1 As New OpenFileDialog()
       Dim constr As String
       'Dim con As OleDb.OleDbConnection
       Dim con As OleDbConnection

       Try

           OpenFileDialog1.Filter = "Excel Files | *.xlsx; *.xls; *.xlsm;"

           If OpenFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
               Me.txtOpen.Text = OpenFileDialog1.FileName

               constr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source=" + txtOpen.Text + ";Extended Properties = Excel 8.0;HDR=Yes;IMEX=1"
               'constr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + txtOpen.Text + ";Excel 12.0 Xml;HDR=YES"
               con = New OleDbConnection(constr)
               con.Open()

               cboSheet.DataSource = con.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, Nothing)
               cboSheet.DisplayMember = "TABLE_NAME"
               cboSheet.ValueMember = "TABLE_NAME"
           End If
       Catch ex As Exception
           MessageBox.Show(ex.Message)
       End Try
Posted
Updated 16-Apr-18 15:47pm
Comments
Richard MacCutchan 13-Apr-18 4:58am    
Are you sure that the Jet and ACE drivers are installed on the system?

You have to ensure that the Jet driver is installed. But that is only available as 32-bit version. So your application must be build as 32-bit (target platform x86 and not Any CPU).

If possible use the ACE driver instead because Jet is deprecated since many years.
 
Share this answer
 
You can't use Microsoft.Jet.OLEDB.4.0 within .xlsx files. You have to use Microsoft.ACE.OLEDB.12 instead.
See: Excel connection strings - ConnectionStrings.com[^]

To resolve your issue, check this: Jet for Access, Excel and Txt on 64 bit systems - ConnectionStrings.com[^]

For further details, please see: HOW TO: FIX ERROR - "the 'microsoft.ace.oledb.12.0' provider is not registered on the local machine"[^]
 
Share this answer
 
v2
Thank you! :) .................
 
Share this answer
 
Comments
Maciej Los 17-Apr-18 6:36am    
Please, delete such of content, because it isn't an answer. To say "Tahnk you", use "Have a Question or Comment" widget.
Cheers,
Maciej

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900