I opened an xls file containing sheets with Russian names. There was a VBA macro that accessed those sheets. When I tried to launch the macro, LibreOffice Calc crashed.
When I looked at the macro, I saw that Russian strings (sheet names, etc.) were mangled, i.e., incorrectly converted from Excel (in Excel all Russian strings are OK). When I manually typed normal Russian strings in VBA editor in Calc (instead of the mangled ones), LibreOffice Calc stopped crashing.
It seems that also other functions, like MsgBox do not work with such mangled Russian arguments.
Please attach a document we can test with and set to UNCONFIRMED.
Is your macro password-protected?
Dear Bug Submitter,
This bug has been in NEEDINFO status with no change for at least
6 months. Please provide the requested information as soon as
possible and mark the bug as UNCONFIRMED. Due to regular bug
tracker maintenance, if the bug is still in NEEDINFO status with
no change in 30 days the QA team will close the bug as INVALID
due to lack of needed information.
For more information about our NEEDINFO policy please read the
wiki located here:
If you have already provided the requested information, please
mark the bug as UNCONFIRMED so that the QA team knows that the
bug is ready to be confirmed.
Thank you for helping us make LibreOffice even better for everyone!
This NEEDINFO Message was generated on: 2015-06-08
Dear Bug Submitter,
Please read this message in its entirety before proceeding.
Your bug report is being closed as INVALID due to inactivity and a lack of information which is needed in order to accurately reproduce and confirm the problem. We encourage you to retest your bug against the latest release. If the issue is still present in the latest stable release, we need the following information (please ignore any that you've already provided):
a) Provide details of your system including your operating system and the latest version of LibreOffice that you have confirmed the bug to be present
b) Provide easy to reproduce steps – the simpler the better
c) Provide any test case(s) which will help us confirm the problem
d) Provide screenshots of the problem if you think it might help
e) Read all comments and provide any requested information
Once all of this is done, please set the bug back to UNCONFIRMED and we will attempt to reproduce the issue.
Please do not:
a) respond via email
b) update the version field in the bug or any of the other details on the top section of FDO
Message generated on: 2015-07-18
Created attachment 162439 [details]
workbook with macro, described in the testcase
The workbook contents macro to represent the bug regarding corrupted Cyrillic letters in macro body, after the file is saved as .xls in LO.
It writes word "проба" in cell A1. But after being saved by LO, the letters are corrupted and the macro prints "?????" instead of "проба"
The content of the macro:
ActiveSheet.Cells(1, 1).Value = "проба"
Igor: I can reproduce with your file, but only on Linux. It works fine on Windows. Which operating system were you using?
Was the file created in Microsoft Office? Which version?
Arch Linux 64-bit
Build ID: 076c95b27bf0e9be1fa1c077674cf974b22210fd
CPU threads: 8; OS: Linux 5.7; UI render: default; VCL: kf5
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Built on 27 June 2020
I tested further and noted the problem is not yet in Linux 50max bibisect repo, but is already in the oldest of 6.3 repo. So this is not the same issue as the original 2014 report. Let's keep hijacking this report anyway.
Buovjaga: Windows 10 LTSB 64bit English on Intel x86 CPU.
I have this issue on LO 6.3, 6.4 and now on 7.0
The xls is created on Excel 2016 EN, I can try other versions as well.
Steps to reproduce (I missed to write it ):
1. Create .xls file in MS Excel with macro (or use the attached file on 2020-06-26):
ActiveSheet.Cells(1, 1).Value = "проба"
2. Save and close the xls file.
3. Open in Calc - everything works fine. You can see "проба" inside macro body.
4. Save the xls file using Calc. Close Calc
5. Open the xls file in Calc again. Open the macro for edit. The word "проба" is corruped, and shows as "?????"
In 2016-17 we had the same issue in another place (Win 7 Ultimate EN, Excel 2003 EN, LO 5.1 fresh branch). We downgraded to LO 126.96.36.199 still branch - no bug there. That configuration still works fine there. If it is helpful, I can test LO 188.8.131.52 and LO 7.0 with Win 10 EN, Win 8 EN and with Excel 2003/2013/2016.
Hmm, weird that I was unable to reproduce on Win 10 with any version. Maybe there is some dependency that we have no clue on.
Buovjaga: I am sorry, I have launched the old configuration (Win 7, Excel 2003, LO 184.108.40.206) and it have another bug there - it removes the macro module, after saving.. So I will test it with different configurations and prepare a pivot report of the results. So it doesn't work fine, as I have pointed earlier.
Created attachment 162528 [details]
Tests of diferent configurations for the bug
Here I fill the tests. Until this moment I have made 13 tests on 3 computers.
Version 220.127.116.11 and some versions earlier work fine on all computers. Next version (18.104.22.168) corrupts the file.
There are video-links attached as well, so you can see what exactly I see.
Hmm, weird, now I get the problem with fresh master on Windows.
I bibisected with Win 5.1 repo and there were some skipped commits and also a chunk containing a range of commits. I think this is roughly the range where the problem appeared:
It certainly contains commits to vba export code.
LibreOffice reads PROJECTCODEPAGE record  (in this file it's Windows-1251) in VbaProject::readVbaModules (oox/source/ole/vbaproject.cxx). It uses the codepage to decode the strings in the project, but then forgets the value, and when writing, uses hard-coded Win-1252, naturally turning everything not representable in that codepage into question marks.
Code pointer: writePROJECTCODEPAGE in oox/source/ole/vbaexport.cxx.
 [MS-OVBA] sect. 22.214.171.124.1.4 https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-ovba/575462ba-bf67-4190-9fac-c275523c75fc
*** Bug 107882 has been marked as a duplicate of this bug. ***
*** Bug 118179 has been marked as a duplicate of this bug. ***
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":
tdf#75263 - Export VBA-Project using detected charset on import
It will be available in 7.4.0.
The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.
*** Bug 149882 has been marked as a duplicate of this bug. ***