Skip to content

Commit 5b0b12c

Browse files
Geronimo BergkGeronimo Bergk
authored andcommitted
DOC: Add security note for Excel export with formula cells
1 parent 6bcd303 commit 5b0b12c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/core/generic.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2252,6 +2252,12 @@ def to_excel(
22522252
and cell character count does not exceed Excel's limitations.
22532253
All other limitations must be checked by the user.
22542254
2255+
Excel treats any cell starting with `=` as a formula, which can pose security
2256+
risks. To store such content as plain text, prepend an apostrophe (`'`), e.g.,
2257+
change `"=foobar"` to `"'=foobar"`. For `xlsxwriter`, you can use
2258+
`engine_kwargs={"options": {"strings_to_formulas": False}}` to disable formula
2259+
interpretation without prepending an apostrophe.
2260+
22552261
Examples
22562262
--------
22572263

0 commit comments

Comments
 (0)