Preserving Equations in Objects

I was wondering if you support, or plan to support the preservation of Equations in Objects (Shapes, Text Boxes, Etc)

When loading and saving a xlsx sheet that has a shape (eg rectangle) that contains an equation to equal the text in cell A1, the equation has been removed, and the object is blank.

Flexcel Version


I think it is fasible to preserve those indeed: the reason they aren't is that I wasn't even aware you could do that. I'll investigate and let you know when I have more information.

Thanks for looking into it for me.

I have a test case if that will help you out.

When I copy sheets from one spreadsheet to another my equations get turned into text in a textbox.  There is nothing fancy about my equations, they just sit on the sheet.  Is there any way of preserving equations.  I'd even accept turning them into images if that would keep the equation looking correct.

Obviously keeping the equation as an equation would be preferable.

I am using TMS FlexCel Studio for VCL and FireMonkey

Update.  It is not the copy operation.  If I load an Excel file with an equation in it and immediately save it, the equation is converted to text in a textbox.


I think you are speaking about a different topic than the previous thread: The original post wasn't about equation objects but about formulas associated to autoshapes or objects (you associate formulas with objects by writing the formulas with the object selected in the formula bar).

Now, about your particular issue, it is not that they are converted into textboxes, as no conversion is going on (if you look at the original file you'll see the equation is also a textbox). The issue is that not all the subscript/etc stuff is being preserved in the comboboxes in xlsx.

I am taking a look right now to see how this can be fixed. In the meantime, if you can save as xls instead of xlsx, I think it should work fine.

A little more info: What is happening here is that Excel is saving 2 versions of the equation here in xlsx format:
One for Excel 2007 or older, and one for Excel 2010 and newer. FlexCel is reading the 2007 version, and so it is showing that alternate content that you saw.

For example, here is how the equation looks in Excel 2010 and 2007 (no FlexCel involved). Excel 2007 is on a VM with a different screen scaling so it looks smaller, but the important thing is that the equation doesn't look ok in Excel 2007:

Also note at the top left that the equation is just a textbox.

FlexCel by default tries to be "conservative" and read the oldest definition of an object when there are multiple definitions, because that's the definition every Excel version can read. So here we are reading the Excel 2007 definition and behaving like Excel 2007 behaves.

I will see if I can change FlexCel to read the Excel 2010 definition too: but the problem is that we also need to preserve the Excel 2007 definition so in case someone with Excel 2007 opens the file they can at least see the text. And if you modify the text of the textbox with FlexCel, we should modify both the 2007 and the 2010 text too, and I am not really sure on how to convert one to the other.

But I'll see to at least preserve the 2010 text if you don't change it. 

As a final note, only make use of this "equations" if you know that your users are all in Excel 2010 or newer. If there is people with older Excel versions, you will have to use a WMF image even when we fix this, or those people won't see the equations.

As said, the equation is not being converted: It is always a textbox (also in the original file). The problem is that Excel 2010 added some extra formatting to allow the textbox to show equations, and it is saving both versions in the file. FlexCel is reading the oldest version available (2007) to ensure all Excel users can read the file it creates. We should modify it to read both versions and save both too, but this isn't technically simple. As said, I'll study what can be done and let you know. Right now, FlexCel is behaving in this case as if an user of Excel 2007 opened and saved the file.

Any progress on reading Excel 2010 format yet?

It is in our todo list. We are planning a new release for monday, and while I am not sure it will make it for that, we'll try it. If not, it will be in the release after monday.

Hi guys,

There were 2 different issues in this thread (Excel 2010 equations and textboxes linked to cells).
Both of them should have been fixed in 6.7.1, released moments ago. Please check it out and let me know if there are still issues.