views:

230

answers:

0

Hi All,

I have generated an xml spreadsheet (*.xls) using XSL. I have another program that reads this spreasheet and processes it.

 Dim sConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + filnavn + ";" + "Extended Properties=Excel 8.0;"

        Dim objCon As OleDbConnection = New OleDbConnection(sConnectionString)

        objCon.Open()

        Dim objCmdSelect As OleDbCommand = New OleDbCommand("SELECT * FROM [General$]", objCon)

        Dim objAdapater As OleDbDataAdapter = New OleDbDataAdapter()

        objAdapater.SelectCommand = objCmdSelect

        Dim _DSGen As DataSet = New DataSet()

        objAdapater.Fill(_DSGen)

I m facing an issue while opening a connection to the generated spreadsheet. It says "{"External table is not in the expected format."}".

My Connection string is

Dim "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + filnavn + ";" + "Extended Properties=Excel 8.0;"

Do i need to change anything to this string ? I tried using a dataset and calling dataSet.ReadXml(excelFileName); But the dataset doesnt contain my table. Any inputs on how to read an xml spreadsheet ?

How to read XML SpreadSheet in OleDb? How to Convert XML SpreadSheet to Microsoft Office Excel Sheet?

Many Thanks