Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TMS FlexCel for VCL & FMX
When generating xls/xlsx files with formulas, Excel shows a message to save when you are closing the file

This message happens when you have any formula in the Excel file, and open it with different Excel versions.

The thing is: If you create a file with formulas in say Excel 2007 and then open the file in Excel 2010, Excel will recalculate all cells and show that message. Sometimes (not always) it also happens in the reverse: If you save with Excel 2010 it might ask you to save when you open in Excel 2007.

This isn’t a FlexCel issue: But in Excel you will normally not see this because in your test machine you will use the same Excel version to save and open the file. But as soon as you start delivering the file to customers, they will start seeing the message.

Now, FlexCel is only one “version": It is not Excel 2003, or 2007, or 2010. So when it creates a file, it needs to say “this file was created with Excel version …” in the file, and this is the value Excel will use to decide if it shows the message or not. If you know that say all your users are in Excel 2013, then you can tell FlexCel to say “this file was saved with Excel 2013” and Excel 2013 users won’t see the dialog. But users of a different version of Excel might.

If you are opening the file in Excel 2013 for example, you can get rid of the dialog by doing:
xls.RecalcVersion = TRecalcVersion.Excel2013;
or just do
xls.RecalcVersion = TRecalcVersion.SameAsInputFile;
to make FlexCel save the “version” used in recalculation as the same version the input file had.