none
Provider for Microsoft Excel version 2.0

    Question

  • hi,

    In foxpro there is a command like:

    "Copy to [path] [condition] xls" that export data from foxpro dbfs to Microsoft Excel.In this case excel version is 2.0.

    Problem:I want to read this exported excel file with C#.So i try to use this providers:

    Provider=Microsoft.ACE.OLEDB.12.0

    With this properties:

    Extended Properties=Excel 8.0;HDR=Yes;IMEX=1;
    Extended Properties=Excel 12.0;HDR=Yes;IMEX=1;

    But they didn't work(I caught this error):

    External table is not in the expected format.

    Is there any way to read Microsoft Excel 2.0 files in C#?I need a provider to read it(as DataTable) and I don't read it by using the VSTO!

    PS: Foxpro Exported file read(shown) by Microsoft Excel 2003 or 2007 or 2010 very easy and simple.I don't know why I can't read it with C# and Microsoft Excel Providers? 

    Regards,

    Mohsen



    • Edited by DevePlex Saturday, August 25, 2012 10:02 AM
    Saturday, August 25, 2012 9:54 AM

Answers

All replies

  • Wow, these files are pretty old, aren't they? 25 years..

    I think the easiest solution would using FoxPro itself to export these files.

    Saturday, August 25, 2012 11:41 AM
  • Yes,they are (We're use FoxPro here man,it's really good! :d).

    Notice that I export those files with FoxPro to Excel,But outcome files version is in Excel 2.0!

    I can't read it in C#,But it show correctly an easily in Microsoft Excel(97 and later).

    So problem is i can't read Microsoft Excel 2.0(*.xls) files in C#.

    Regards,


    There are only 10 types of people in the world: those who understand binary, and those who don't.

    Saturday, August 25, 2012 5:51 PM
  • Then you should consider using Excel automation to convert the file format.
    Sunday, August 26, 2012 12:35 PM
  • Then you should consider using Excel automation to convert the file format.

    Thank you.

    How can I do that?I can't read these file normally with C#,how can I convert they to another(for example xlsx)format?


    There are only 10 types of people in the world: those who understand binary, and those who don't.

    Sunday, August 26, 2012 4:38 PM
  • You should be able to read the binary data from FoxPro and write these files to disk. Then use Excel automation to open these files and save them in a newer format.

    Sunday, August 26, 2012 5:53 PM