Closed stenvaag closed 1 year ago
Greetings,
I am using libxlsxwriter to create a spreadsheet equal to an old one I have.
The old spreadsheet uses the equal sign in the beginning of a string. To avoid evaluation when selecting this cell for editiing in Excel I need the quotePrefix attribute.
Here is some code that demonstrates the problem:
#include "xlsxwriter.h" int main() { lxw_workbook *workbook = workbook_new("quoteprefix.xlsx"); lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL); worksheet_write_string(worksheet, 0, 0, "= Hello", NULL); return workbook_close(workbook); }
Opening the quoteprefix.xlsx in Excel and start editing the cell and press just press Enter, the cell content changes to #NAME?.
After patch
#include "xlsxwriter.h" int main() { lxw_workbook *workbook = workbook_new("quoteprefix.xlsx"); lxw_format *quote = workbook_add_format(workbook); format_set_quote_prefix(quote); lxw_worksheet *worksheet = workbook_add_worksheet(workbook, NULL); worksheet_write_string(worksheet, 0, 0, "= Hello", quote); return workbook_close(workbook); }
A patch is attached. libxlsxwriter-quote_prefix.txt
Sure, I can look at that for the next release.
Add on main.
Greetings,
I am using libxlsxwriter to create a spreadsheet equal to an old one I have.
The old spreadsheet uses the equal sign in the beginning of a string. To avoid evaluation when selecting this cell for editiing in Excel I need the quotePrefix attribute.
Here is some code that demonstrates the problem:
Opening the quoteprefix.xlsx in Excel and start editing the cell and press just press Enter, the cell content changes to #NAME?.
After patch
A patch is attached. libxlsxwriter-quote_prefix.txt