Hi.
I am using Aspose.Cells for .NET 7.1.2. I have a file named “FichODS_2.ods”, (that i included here as an attachment), that has a macro. I tried to run the following simple code (inside a Web Application):
Aspose.Cells.Workbook w = new Aspose.Cells.Workbook(
“c:\temp\FichODS_2.ods”);
w.SaveOptions.SaveFormat = SaveFormat.ODS;
w.Save(Response, “mmmmm.ods”, ContentDisposition.Attachment,
w.SaveOptions);
The code works fine, but the generated file has no macros! Is this the expected behavior?
Thank you.
Ricardo Coimbras
Hi,
I think, macros are not preserved in ODS file.
However, for the correct answer, I have forwarded your question to our development team. It will guide you better.
I have logged this issue in our database. Once the issue is fixed or we have some update relating to it, we will let you know asap.
This issue has been logged as CELLSNET-40528.
Hi,
Have you already an answer to my question?
If macros are not preserved, when do you plan to fix it?
Sincerely,
Ricardo Coimbras
Hi,
Please download and try the latest version:
Aspose.Cells
for .NET v7.1.2.7
and let me know your feedback.
Hi.
With that version, the 2nd line of the following code generates a compilation error:
Aspose.Cells.Workbook w = new Aspose.Cells.Workbook(
@“c:\FichODS_2.ods”);
w.SaveOptions.SaveFormat = SaveFormat.ODS;
w.Save(Response, “file1.ods”, ContentDisposition.Attachment, w.SaveOptions);
The error is:
Property or indexer ‘Aspose.Cells.SaveOptions.SaveFormat’ cannot be assigned to – it is read only
Hi,
Please use the following code as I have shown. You need to use OdsSaveOptions
Please also download and use the current latest version:
Aspose.Cells
for .NET v7.2.0.1
and let me know your feedback.
C#
Workbook w = new Workbook(@“c:\FichODS_2.ods”);
w.Save(HttpContext.Current.Response, “file1.ods”, ContentDisposition.Attachment, new OdsSaveOptions(SaveFormat.ODS));
Yes, I am afraid, you need to update your existing codes a bit. We feel it might not be worth while to provide separate SaveFormat attribute when we already allow to set the SaveFormat in the constructors of the APIs. See the following lines for your reference. You should use SaveOptions APIs' constructors to specify the SaveFormat accordingly now.
e.g.
//Html
var htmOptions = new HtmlSaveOptions(SaveFormat.Html);
//XLSX
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions(SaveFormat.Xlsx);
//XLSM
var saveOptions = new OoxmlSaveOptions(SaveFormat.Xlsm);
//PDF
PdfSaveOptions saveOption = new PdfSaveOptions(SaveFormat.Pdf);
//ODS
OdsSaveOptions saveOptions = new OdsSaveOptions(SaveFormat.ODS);
//XLS Response.
workbook.Save(HttpContext.Current.Response, "test.xls",
Aspose.Cells.ContentDisposition.Attachment, new XlsSaveOptions(Aspose.Cells.SaveFormat.Excel97To2003));
HttpContext.Current.Response.End();
etc.
Hi.
It didn’t work either with v7.2.0.1 and v7.1.2.7.
Kind regards,
Ricardo Coimbras
Hi,
Yes, I can notice the issue as you mentioned, the macros like, “Test1” is removed in the output file. I have logged my comments to attach with your issue “
CELLSNET-40528” now. We will soon look into it.
Once we have any update, we will let you know here.
Thank you.
Hi,
We have fixed this issue.
Please download and use this latest fix: Aspose.Cells for .NET v7.2.1.4 and let us know your feedback.
Hello.
The problem is solved with that fix.
Another question: this fix is included in version 7.2.2 and newer versions, is that correct? So, now I have another problem: the subscription included in my license allows free upgrades only until 26 May 2012, and 7.2.2 was released after. Since it is a malfunction, how can I get this fix working?
Thank you.
Hi,
Thanks for your posting and using Aspose.Cells for .NET.
Please check your license subscription expiry date. If this fix is released earlier, then you can use it without any need to renew your subscription.
However, if your license subscription has already expired, then I am afraid, you will have to renew your license subscription to use this fix and later releases.
Please contact Aspose.Purchase department for your more help in this regard.