Huge filesize when saving with hidden rows or cols

Hi,

I am working with excel templates that have hidden rows and columns. For example a sheet, that has all rows above 50 are hidden, and all columns above 20, too.

When opening the template and saving it again the filesize is about 1,5mb, but the template has only 20kb.

I am using Aspose.Excel 2.8.3.0!

Any hints?

Michael Mann

Dear Michael,

I test it in my machine and don’t find any problem.

Do you access the cells in those hidden areas?

Could you please send me your template and the generated file? I will check it.

Hi,

no I don’t access the cells in the hidden area. I sent my example to
excel@aspose.com with the same subject.

I ran the example on my machine and the saved file size has raised from 18kb to 1,4mb.

Thanks
Michael

Hi,

can you reproduce the problem with my example?

Michael

Hi Michael,

Please download and try v2.8.6

And please remove your code to hide rows. Those lines of code increased the file size.

Hi Laurence,

I got your hotfix, but I’m not able to open an excel template using a stream any more.
I sent you the same example as before with the same subject in the mail heading.

Thanks
Michael Mann

Hi Michael,

In previous version, Aspose.Excel can open a file with dual format, for example, your file with “Microsoft Excel 97 - 2002 & 5.0/95 workbook” format. However, we find there are some problem since Aspose.Excel doesn’t support Excel95 and before format any more.

So please use Excel97 or above version MS Excel to open your template and save them as “Microsoft Excel Workbook”. Then all will be fine.

Hi Laurence,

thanks for the hint - that did it. All works fine.

Michael

@Mischi,
Aspose.Cells has replaced Aspose.Excel that is no more under active development now. This new product has advanced features to hide/show the rows/columns, scroll bars, row/columns headers and other elements. Following example demonstrates the feature to show the hidden rows and columns.

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET

// Creating a file stream containing the Excel file to be opened
FileStream fstream = new FileStream(dataDir + "book1.xls", FileMode.Open);

// Instantiating a Workbook object
// Opening the Excel file through the file stream
Workbook workbook = new Workbook(fstream);

// Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.Worksheets[0];

// Unhiding the 3rd row and setting its height to 13.5
worksheet.Cells.UnhideRow(2, 13.5);

// Unhiding the 2nd column and setting its width to 8.5
worksheet.Cells.UnhideColumn(1, 8.5);

// Saving the modified Excel file
workbook.Save(dataDir + "output.xls");

// Closing the file stream to free all resources
fstream.Close();

Refer to the following articles that provide more details about these features:
Hiding and Showing Rows and Columns
Show and Hide Rows Columns and Scroll Bars
Display or Hide Row Column Headers in Aspose.Cells
Show and Hide Elements

For trials purpose latest version can be downloaded here:
Aspose.Cells for .NET (Latest Version)

To test different features of this product download a runnable solution here.