Aspose excel file size is to large

Hello,

I am using aspose cell for saving and downloading Excel file in asp.net application.
My problem is when i download the excel file the size is 90 MB. After i open this file manually and re-save the file its size is 4 MB. and actually row in that file also 1890 Only
i want to when i download the file its to be smaller like 4 MB what should i do for this problem.

e.g - : lXLSworkbook.Save(lFilePath & lFileName, Aspose.Cells.FileFormatType.Excel2003)

Regards,
Pratik

Hi Pratik,


Thanks for your query.

Well, to evaluate your issue on our end, we need your template Excel file and sample code (runnable). Kindly provide your template file and preferably a sample application (runnable) to reproduce the issue on our end (you may zip it prior attaching here), we will check it soon.

Also, kindly give our latest version/ fix a try: Aspose.Cells for .NET 8.3.2.3 if it makes any difference.

Thank you.

Hi, I am currently suffering from the same problem. I am trying to convert the program that used Interop to now use Aspose.Cells, but it seems I have to create more named ranges than in Interop since Aspose does not support range.offset() or range.resize() methods. Is creating multiple(I mean, a lot) named ranges result in booming the output file size? Mine increased from 13MB to 40MB.

@SYum,

Well, you may try to use NameCollection and Name objects to create and instantiate named ranges. Also, you may use Name.RefersTo attribute to specify.respecify the formula/cells area accordingly.

Moreover, to evaluate your issue on our end, we need your template Excel file and sample code (runnable). Kindly create a separate a simple sample application (runnable) with Aspose.Cells APIs (v17.7 (latest version)) to reproduce the issue (regarding file size) on our end (you may zip it prior attaching here), we will check it soon.

Thank you.

Sure.

I am working on preparing the sample project that you can compile and run.

In the meantime, I would like to find out if there is any function that cleans all the named ranges and ranges that just sit in the file with out being referenced again(Just like Malloc() in C)
Is there any function that enables me to do so? I tried Names.removeAt(), but it merely erases the name of a named range.

@SYum,

I think you may remove all the named ranges using the following sample code:
e.g
Sample code:

..............
 List<string> toRemove = new List<string>();
            foreach (Name item in workbook.Worksheets.Names)
            {
                toRemove.Add(item.FullText);
            }
            foreach (var item in toRemove)
                workbook.Worksheets.Names.Remove(item);
..............

Let us know what issue you still find, you may provide us sample Excel file and some screenshots to highlight the problem, we will check it soon.

Thank you.