I have a form that allows a user to upload a microsoft Excel Spreadsheet. (I
am testing with one created in Excel 2000)
The spreadsheet is uploaded correctly.
It is then supposed to be read and display in a datagrid. When the code
executes I get:
System.Data.OleDb.OleDbException: Could not find installable ISAM
here is the snippet that is to read the excel file:
<code>
If bolContinue = True Then
'Open the Excel file for import to the temp table in SQL
server
Dim strExcelConnector As String
strExcelConnector = "Provider=Microsoft.Jet.OLEDB.4.0;
DataSource=" + strFileName + "; Extended Properties=Excel 8.0;"
Dim conExcel As New
OleDb.OleDbConnection(strExcelConnector)
Dim dsExcel As New DataSet
Dim daExcel As New OleDb.OleDbDataAdapter("Select * from
[Sheet1$]", conExcel)
Try
conExcel.Open()
daExcel.Fill(dsExcel)
DataGrid1.DataSource = dsExcel.Tables(0).DefaultView
DataGrid1.DataBind()
Catch ex As Exception
Throw ex
End Try
daExcel = Nothing
dsExcel = Nothing
conExcel = Nothing
End If
</code>
I know that the file name is correct. Beyond that... this is the first time
I have ever attempted to open an Excel file without excel! ;)
The file name is in the format "d:\wwwroot\inetpub\website\excel\excel.xls"
Note: I found documentation on the web that indicated msexcl40.dll might not
exist or could be in the wrong directory or not match the registry. I have
checked this. The file exists, it is where it belongs and the registry
matches reality.
I have also been looking for permissions issues (in case that was it) but
there are none.
Any ideas?
Thanks.