Created attachment 142932 [details] Example file from Excel If we use XlSpecialCells range method in visual basic code created by Microsoft Excel 2013/2016, and open with LibreOffice Calc and run the macro, the “SpecialCells(xlCellTypeConstants, 1)” method is ignored. Steps to reproduce: 1. Create a new spreadsheet with Microsoft Excel 2016/2013 2. Fill a range (for example A1:V30) with numbers and letters 3. Open the Visual Basic window 3. Add a new Module to your VBAProject 4. Copy this VBA code to your module: Sub kijeloles_adatok() Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select Selection.SpecialCells(xlCellTypeConstants, 1).Select With Selection.Interior .Pattern = xlSolid .Color = 5287936 End With ActiveSheet.Range("A1").Select End Sub 5. Save the file as *.xlsm 6. Open the file in LibreOffice Calc and run the macro. Actual results: The macro is run without an error, but the Selection.SpecialCells(xlCellTypeConstants, 1) method was ignored. Instead of filling the numbers with color the macro fills all the range with color. Expected results: The SpecialCells(xlCellTypeConstants, 1) method should work correctly. Version: 6.0.0.0.beta1+ Build ID: 29228e83df009cf76ac819ed024527be1092f065 CPU threads: 4; OS: Windows 6.1; UI render: default; TinderBox: Win-x86@42, Branch:libreoffice-6-0, Time: 2017-12-04_23:15:34 Locale: hu-HU (hu_HU); Calc: group threaded
Created attachment 142933 [details] Result of the macro in Excel and Calc side by side
Repro. Arch Linux 64-bit Version: 6.2.0.0.alpha0+ Build ID: 5b42a17dc99fba2ccf8dd8d0a8e0e4e836e30120 CPU threads: 8; OS: Linux 4.17; UI render: default; VCL: kde4; Locale: fi-FI (fi_FI.UTF-8); Calc: group threaded Built on June 22nd 2018 Win 10 Version: 4.3.0.0.beta1 Build ID: b7cfa1eab1cb1e94f71d6df6612b73f231d0bf92
https://opengrok.libreoffice.org/xref/core/sc/source/ui/vba/vbarange.cxx?r=c12c84e6#5460 https://opengrok.libreoffice.org/xref/core/sc/source/ui/unoobj/cellsuno.cxx?r=316b07d0#3482 https://opengrok.libreoffice.org/xref/core/offapi/type_reference/offapi.idl?r=20c6d7f6#11469 btw, no flags to select error value?
probably confusion is coming from Excel's "Go To Special" dialog. https://www.excel-easy.com/basics/find-select.html#go-to-special It looks as if checkbuttons are enabled only when Formulas radiobutton is selected and are disabled when Constants radiobutton is selected. but in reality, Checkbuttons are enabled even when EITHER Constants radiobutton OR Formulas radiobutton is selected.
Dear Gabor Kelemen, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
Andreas Heinisch committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/f972f27b455ef78f0d5db5eea96edd707909a154 tdf#118247 - Correctly handle xlCellTypeConstants parameter It will be available in 7.5.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: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
This patch only resolves the correct handling of SpecialCells(xlCellTypeConstants, 1) and does not resolve the problems around multiple selection ranges of the ScVbaInterior object in the following code snippet: Selection.SpecialCells(xlCellTypeConstants, 1).Select With Selection.Interior .Pattern = xlSolid .Color = 5287936 End With
and thx to himajin100000@gmail.com for the code pointers!