Opening Excel 2007 file- saving as Excel 97-2003 file

I am currently evaluating ASPOSE Cells. I need to accomplish the following:

1. Open Excel 2007 file (extension .xlsx) which is uploaded to the server

2. Save it as an Excel 97-2003 file (extension .xls)

And...

1. Open Excel 97-2003 file on server

2. Save it as an Excel 2007 file

Can this be done?


This message was posted using Aspose.Live 2 Forum

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for considering Aspose.

Yes, you can open Excel 2007 Xlsx files and save them in XLS file format and vice versa. Please see the following documentation link regarding the details about opening and saving of different excel file formats.

http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/opening-files.html

http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/saving-files.html

If you need any further assistance, please feel free to contact us. We will be happy to help you out.

Thank You & Best Regards,

Trying to figure out the correct syntax for opening and saving a file in classic ASP.

Here is a code snippet of the ASP script

----------------
filexlsx= “” & xlsxfilename
filexls = “” & xlsfilename

Dim workbook
Dim xlsxfile
Dim xlsfile

Set workbook = Server.CreateObject(“Aspose.Cells.Workbook”)
workbook.open filexlsx, FileFormatType.Excel2007Xlsx ’ Open the XLSX file
workbook.save filexls, FileFormatType.Excel2003 ’ Save as XLS file
--------------------

The above gives an error on the workbook.open line. Error: "Object required: FileFormatType"

Any ideas?

Thanks in advance!




Hi,

Please use the constant values for the enumeration types and take care about overloaded version numbers in Classic ASP.

e.g

Set workbook = Server.CreateObject(“Aspose.Cells.Workbook”)
workbook.open_6
filexlsx, 6 ’ Open the XLSX file
workbook.save_5
filexls, 5 ’ Save as XLS file

or you may even skip it. the product would auto detect the file format types.

Set workbook = Server.CreateObject(“Aspose.Cells.Workbook”)
workbook.open_5
filexlsx ’ Open the XLSX file
workbook.save_4
filexls ’ Save as XLS file

Note: We do provide a TLB file with the Aspose.Cells.dll library. Please open this file into VS.NET to know about the APIs and the constant values for enumerations.

Thank you.