locked
possible bug with importing excel html format xls files with carriage returns using jet. Where to post? RRS feed

  • Question

  • Hi all

    I'm using the jet provider to import data from an xls file. The xls file is in html format. The import is working fine using a connection string such as:

    m_sConn1 =

    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=""" & Filename & """;"Extended Properties=""HTML Import;"""

    I have an excel file with 1 row and 3 cells in that row, Eg. |Contract ID|Expenditure Category|Expenditure Sub Category|

    Save as htm format and then rename the file to xls. This file opens fine in excel and displays correctly BUT when using the jet provider to access the file, the values appear as |Contract ID|Expenditure Category|ExpenditureSub Category|  (note the missing space)

    I've diagnosed this by opening the xls file into notepad. I can see that Excel saves some values across two lines: eg.

     <tr height=17 style='height:12.75pt'>
      <td height=17 width=72 style='height:12.75pt;width:54pt'>Contract ID</td>
      <td width=134 style='width:101pt'>Expenditure Category</td>
      <td colspan=2 width=226 style='mso-ignore:colspan;width:170pt'>Expenditure
      Sub Category</td>
     </tr>

    not sure where to post this issue. I have tested this using dotnet code to access the file, and also just using excel to 'import data' -> select advanced connection, select Jet provider, set Extended Property to 'HTML Import'.

    both methods return the same result so I'm thinking it's a bug in the jet provider.

    appreciate any advice on where to post this issue to get the right audience.

    thanks

    Andrew

    Thursday, July 2, 2009 2:08 AM

Answers

All replies