I am trying to load in a spread sheet for a user to quickly look up info without needing to keep the spreadsheet open.
I've looked through several different threads on this and nothing seems to help me. Maybe someone can spot the issue i'm missing?
when i run the above code, the form starts to load and the dialogbox pops up asking the user to select the spreadsheet to use(this will be taken out sense this will only be made for one spreadsheet but just using for now as a debugging purpose) and i get the "Could not find installable ISAM" with just an OK button that just shuts everything down.Code:Imports Microsoft.Office.Interop Public Class Form1 Dim conn As OleDb.OleDbConnection Dim dta As OleDb.OleDbDataAdapter Dim dts As DataSet Dim excel As String Dim openFile As New OpenFileDialog Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Try openFile.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments 'openFile.filter = "All Files (*.*)|*.*|Excel Files (*.xlsx)|*.xlsx|Xls Files (*.xls)|*.xls" If openFile.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK Then Dim fi As New IO.FileInfo(openFile.FileName) Dim filename As String = openFile.FileName excel = fi.FullName conn = New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.16.0; Data Source=" + excel + ";Extended Properties = Excel 16.0 Xml;HDR=NO;IMEX=1") dta = New OleDb.OleDbDataAdapter("select * From [Current orders$]", conn) dts = New DataSet dta.Fill(dts, "Current orders$") dgvExcelInfo.DataSource = dts dgvExcelInfo.DataMember = "[Current orders$]" conn.Close() End If Catch ex As Exception MsgBox(ex.Message) Exit Sub End Try End Sub
I appreciate any that is given.




Reply With Quote
