Issue while opening .XLSM workbook

Hi Aspose Team,

I am using Aspose to generate Excel report along with .NET. I have .NET windows service which is creating excel report. When I am creating report locally, I am facing no issue and .XLSM file is create properly. But when I have deployed code on server and am trying to genrate report, I am facing two Issues.

Issue 1: In some cases report is genrated successfully but when i try to open it, I am getting excel prompt as attached(Error.jpg) in some scenarios. But it is working fine with local code in all scenarios. I am using aspose 7.6.1.2 version currently. Kindly suggest on this issue.

Issue 2: I am getting Security Warning (as attached) when opening report. When i click on Option and select enable, report is working file. I want this option to get enable through code. Kindly let me know how it can be done.

Thanks

Nabila

Hi Nabila,

Thank you for using Aspose products.

Issue 1: The behavior you have mentioned is strange to me because if code to generate the report is fine it should always create a perfect spreadsheet. I am unable to understand why your application works fine on local and tends to fail (occasionally) when deployed. We would request you to please provide a sample runnable application along with environment details such as Operating System version, Service Pack version, .NET Framework version, in order to look further into this matter. Moreover, you can also give a try to our latest version of Aspose.Cells for .NET 7.7.1.2, and let us know how it goes on your production.

Issue 2: Security warnings in MS Excel 2007 has nothing to do with Aspose.Cells API. This is actually security check imposed by MS Excel 2007 if spreadsheet are downloaded via browser/email/internet. Same warning can appear due to other reasons as well. Please have a look at below linked related article.
http://blogs.msdn.com/b/vsofficedeveloper/archive/2008/03/11/excel-2007-extension-warning.aspx

Hi Babar,

Thanks for updating us on cause of 2nd issue.

For first Issue , I am not able to get solution with new DLL provided.

Please find some detail on my application to understand the issue. I am working on .NET 4.0 framework using C# and my application is windows service running on MS Windows Server 2003(Service pack 2). This service is called from Java web application to genrate report. So what service will do is , it will take input from web application, get some data from DB2, some formatting info from XML files and using Marker it will write data on excel file. Now when i am testing .net windows service using some window client form, it is running fine and report is created. But when we have deployed DLLs and are trying to genrate report from Java Web Application, we are getting this error. Kindly suggest us on this.

Hi Nabila,

Thank you for sharing more details of your scenario. Unfortunately we still need your source code along with template file (if any) in order to thoroughly investigate the problem cause. Please note, it is essential for us to replicate the issue on our end before logging a ticket for ratification. Due to the strange behavior as discussed in your both posts, we have logged an investigative ticket (CELLSNET-42331) and sought help from the development end in this regard.

It is requested that please share a sample application replicating the problem. I would suggest you to first isolate the problem by just using Aspose.Cells for .NET API in your project. This will help you/us to understand if any third party tool integrated in your application is causing the said problem. Moreover, please confirm if you can get a perfect report by making a request from Java web application that resides on the same machine as of the windows service using Aspose.Cells API.

Looking forward to your sample application.

Hi Babbar,

Today I was able to replicate one issue locally also. When I create a sample Window form application and call service , report is created properly. But when I am trying to open report through Web application, i am getting error as "Some error in Formula or reference". Please find attached Test report. If you open this report directly, no pop up will appear but if we try to open it through web browser using web application, i am getting pop up message. Also find attached sample code. select web appication and on click of button paste attached code. In this code we are trying to open "TestReport.xlsm" file from some path.(modify path accordingly)

please check if you are able to get the issue.

Hi Nabila,

Thank you for providing your code and sample spreadsheet.

In order to avoid the error mentioned in your recent post, please change the ContentType to “application/vnd.openxmlformats-officedocument.spreadsheetml.sheet”.

Please tell us more about other sample “IYTemplateMarker.xlsm”. For your original issue we will require sample application along with your input and output file. If you can share the corrupt/malformed resultant spreadsheet for now we can start investigation on its basis.

Babbar,

Today i was able to close one issue which is formula error type of pop-up in chart report. The issue was because of some range issue. But we are not able to get that with local code.

Actully before using Aspose , my application was running on Sync fusion and in Sync fusion we have one method called Close for work book. I wanted to know to what is equivalent method in Aspose as i need to close workbook object once report is genrated.

Thanks

Nabila

Hi Nabila,

Good to know that you are making progress.

Please note, all objects of Aspose.Cells are .NET managed objects therefore how and when the resources will be released depends on .NET framework completely. You don’t need to explicitly call Dispose/Close method to release the resources nor such methods are publicly available. If you have stumbled upon a situation where resources are not getting freed properly then please share the sample file as well as code snippet so we could check it on our end to suggest a solution.