简体   繁体   English

创建的xlsx文件删除书面公式

[英]Created xlsx file delete written formula

I create an excel file via slsxwriter and want to put there a formula. 我通过slsxwriter创建了一个excel文件,并希望在其中放一个公式。 I'm doing it like this: 我正在这样做:

sheet.write(2, 6, "=IF(AND(ISBLANK(J2); ISBLANK(K2); ISBLANK(L2)); \\"PASSED\\"; \\"FAILED\\")")

trying also this: 也尝试这个:

sheet.write_formula(2, 6, "=IF(AND(ISBLANK(J2); ISBLANK(K2); ISBLANK(L2)); \\"PASSED\\"; \\"FAILED\\")")

But when I later open created xlsx file, excel want to 'repair' my file and is deleting the formula... (Removed Records: Formula from /xl/worksheets/sheet1.xml part) 但是,当我以后打开创建的xlsx文件时,excel想要“修复”我的文件并删除公式...(已删除的记录:/xl/worksheets/sheet1.xml部分的公式)

When I was putting it by hand in excel it works great. 当我手动将其放入excel时,效果很好。

Anyone has an idea what is going on? 任何人都知道发生了什么事吗?

Formulas are stored in Excel in US English, no matter what language you are actually using. 无论您实际使用哪种语言,公式都以Excel用美国英语存储。 The US English separator is the comma ( , ), not semicolon ( ; ). 美国英语分隔符是逗号( , ),而不是分号( ; )。

See the section titled "Non US Excel functions and syntax" in the chapter "Working with Formulas" in the official documentation. 请参阅官方文档中“使用公式”一章中标题为“非美国Excel函数和语法”的部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM