The xlsx file created with Python+openpyxl is garbled.

Asked 2 years ago, Updated 2 years ago, 351 views

I created an Excel auto-input application using openpyxl, but when I open the created xlsx file in Excel 365 (Windows), it becomes garbled (#).
Enter a description of the image here
I searched various causes and thought that the font was a problem (Droid Sans Fallback), so I rewritten the source code so that it could be entered in Yu Gothic, but there were still garbled characters.
I also found an article that says that if the number of characters exceeds a certain number of characters, the characters will become garbled, but I only entered 2-4 characters per cell.

If you change the file created in openpyxl to a different format in Excel (the classification at the time of input is numerical), it will be solved (it is troublesome to do that every time), so I would like to be able to create a file that does not garbled.Please let me know if there is a good solution.

excel openpyxl

2022-09-30 21:58

1 Answers

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.