tags:

views:

803

answers:

5

How would I convert and Excel 2003 Open XML Workbook to Excel 97 Format using C#?

+1  A: 

Is it simply data or are there formulas and VBA? If it is just data you could read in the file as XML and do use an XSLT to convert the data to a CSV file.

Andrew Hare
+1  A: 

Using Visual Studio Tools for Office, open the workbook and then do a SaveAs, select Excel 97 as the format type.

Nathan DeWitt
A: 

You could try following:

  1. Start Excel
  2. Start Macro recording mode
  3. Open an open-xml workbook.
  4. Save it as Excel 97.
  5. Stop Macro recording mode.
  6. View the generated VBA code and port it to C# using the VS tools for Office mentioned by Nathan.
chiccodoro
A: 

Do you mean Excel 2007 Open XML? There is no Excel 2003 Open XML format. There is an Excel 2003 SpreadsheetML format which is an XML format that is incomplete as well as being a dead end format.

SpreadsheetGear for .NET can read and write both Excel 97-2003 (xls) workbooks and Excel 2007 Open XML (xlsx) workbooks and will convert between the two formats.

There is a free evaluation if you want to try it out.

Disclaimer: I own SpreadsheetGear LLC

Joe Erickson
A: 

You can use "cz excel converter" to Excel 2007 Open XML Workbook to Excel 97 Format, and this tool supports command line interface, so you can call it from your application, you can get more information from http://www.convertzone.com/excel_converter/help.htm

If you need batch convert converts PDF, XLS, HTML, XML, MTH, CSV, TEXT, DBF, Lotus 1-2-3, WKS, WQ1, SLK, DIF and more, "cz excel converter" will help you, it can convert many excel xls files at one time.

regards
flyaga

flyaga