1 Reply Latest reply on Oct 27, 2009 3:22 PM by gdarling - oracle

    How to read XML SpreadSheet using OleDb Provider

      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)


      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()


      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

      "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