I am currently encountering an issue with the xlwings package while working on a project in Excel.
When I use the command xlwings vba edit to import VBA Modules into Visual Studio Code, all special characters (such as "ä", "ö", and "ü") are converted to other symbols. This change is then saved back into Excel, which is causing a lot of problems for me.
My VS Code is set to UTF-8, so I would expect it to handle these characters correctly, but this is not the case.
Here is a step-by-step description of what I am doing:
I am running xlwings vba edit from the terminal.
VS Code opens with the VBA code.
Special characters are not displayed correctly in VS Code.
After saving the code, the same changes are reflected in Excel.
I was expecting the correct encoding in VS Code
Thank you in advance for your help.
2
Answers
It has nothing to do with xlWings. Problem and solution are detailed here: VBA - Import bas module with special characters
I’ve got same issue, found the answer today :
https://blogmotion.fr/programmation/vscode-encodage-accent-point-interrogation-18832
check the auto guess encoding checkbox like this
"xlwings vba edit", enjoy !