Hello,
Hi Pratik,
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.
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.
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.