Free Support Forum - aspose.com

Workbook size increase

Hi,
I’m new to Aspose.Cells and encountered a strange problem.
I open my excel workbook( size 810 KB):

workbook.Open(“c:\1.xls”);

I modify one value in one cell.

workbook.Worksheets.GetRangeByName(“ifldAddress”)[0,0].PutValue(“some value”);

Then I save the workbook:

workbook.Save(“c:\1.xls”);

After this operation the size of workbook is 743 KB. I don’t mind it is smaller but…
When I open this workbook in Excel and save (iExcel claims there are some changes when I try to close it even when I didn’t touch anything) the size of workbook increases to over 16MB :frowning:
There are some macros in the workbook but the situation is the same even when I disable them.
Any idea why?

Cheers


1.Could you please post your source file here?

2.What happens if you just open and save it?

Workbook workbook = new Workbook();

workbook.Open("c:\\1.xls");

workbook.Save("c:\\1.xls");

3. What happens if you remove macros in your source file?

4. And which version of Aspose.Cells are you using?

  1. You mean the workbook file or the c# code?
    2. The same situation.
    3. The same.
    4. Aspose.Cells for .NET v4.0.3 (I had the same problem with previous version)

    The other thing to mention is when I open the workbook in Excel after saving with Aspose.Cells and thy to close it Excel says: “Microsoft Office Excel recalculates formulas when opening files last saved by an earlier version of Excel”.
    My Excel version is 2003 (11.5612.5606).
    The same situation is when I do:

    Workbook workbook = new Workbook();

workbook.Open("c:\\1.xls",FileFormatType.Excel2003);

workbook.Save("c:\\1.xls",FileFormatType.Excel2003);


Please post your source Excel file here.

For Microsoft Office Excel recalculates formulas when opening files last saved by an earlier version of Excel" message, it doesn't matter.When saving a file, Aspose.Cells set a flag to force MS Excel to re-calculate formulas when opening this file. You can just ignore it.

You can send your file to nanjing@aspose.com .

I got you file and find this problem. However, I think it may relate to some odd content in your Excel file. You can verify it by:

1. Open you file in MS Excel.

2. Right-click the first worksheet tab-"Form". Then choose "Move or Copy".

3. In "Move or Copy" window, choose to a "(new book)", and check "Create a copy" option.

4.Click "OK", then "Form" worksheet is copied to a new workbook.

5. Save this new workbook. You will see it's 16MB.

Yes, you are right. It is because of the workbook content, Aspose.Cells is working fine. I will contact the workbook author and find out what’s going on.
Thank you for your help!