Preserve Single Quote Prefix of Cell Value or Range

Possible Usage Scenarios

When you put some value inside the cell that has leading apostrophe or single quote mark, then Microsoft Excel hides it, but when you select the cell, it displays the leading apostrophe or single quote in a formula bar as shown in the following screenshot.

todo:image_alt_text

Aspose.Cells for Python via .NET also hides the leading apostrophe or single quote like Microsoft Excel but it sets the Style.quote_prefix as true for that cell. If you set an empty style of the cell, then Style.quote_prefix becomes false again. In order to deal with this issue, Aspose.Cells for Python via .NET provides Style.quote_prefix property, when it is set false, then Style.quote_prefix is not updated at all and its old value is preserved. It means if the old value of Style.quote_prefix property was true, it will remain true and if the old value was false, it will remain false.

Preserve Single Quote Prefix of Cell Value or Range

The following sample code explains the usage of Style.quote_prefix property as described previously. Please read the comments inside the code and see the console output of the code given below for more help.

Sample Code

Console Output

Quote Prefix of Cell A1: False

Quote Prefix of Cell A1: True

When StyleFlag.quote_prefix is False, it means, do not update the value of Cell.Style.quote_prefix.

Similarly, when StyleFlag.quote_prefix is True, it means, update the value of Cell.Style.quote_prefix.

Quote Prefix of Cell A1: True

Quote Prefix of Cell A1: False