Description: The result of position number is sometimes wrong. Steps to Reproduce: 1. Open a brand new .ods 2. Only Sheet1 will be used to demonstrate 3. Place the code and run Option Explicit Function GetLastUsedColumnOfSheet(pSheetName$) As Long Dim oSheet, oCursor As Object oSheet = thiscomponent.Sheets.getByName(pSheetName) oCursor = oSheet.createCursor oCursor.gotoEndOfUsedArea(False) GetLastUsedColumnOfSheet = oCursor.RangeAddress.EndColumn End Function Function GetLastUsedRowOfSheet(pSheetName$) As Long Dim oSheet, oCursor As Object oSheet = thiscomponent.Sheets.getByName(pSheetName) oCursor = oSheet.createCursor oCursor.gotoEndOfUsedArea(False) GetLastUsedRowOfSheet = oCursor.RangeAddress.EndRow End Function Sub ChangeCellRangeBackgroundColorAndCheckLastUsedCellOfSheet1 Dim row%, r&, g%, b%, t$, lc&, lr& thiscomponent.CurrentController.ActiveSheet = thiscomponent.Sheets.getByName("Sheet1") thiscomponent.Sheets.getByName("Sheet1").getCellRangeByPosition(0, 0, 20, 99).CellBackColor = RGB(r, g, b) For row = 1 To 100 r = Int((255 * Rnd) + 0) ' Generate random value between 0 and 255. g = Int((255 * Rnd) + 0) ' Generate random value between 0 and 255. b = Int((255 * Rnd) + 0) ' Generate random value between 0 and 255. thiscomponent.Sheets.getByName("Sheet1").getCellRangeByPosition(0, 0, 20, row - 1).CellBackColor = RGB(r, g, b) lc = GetLastUsedColumnOfSheet("Sheet1") : lr = GetLastUsedRowOfSheet("Sheet1") If lc <> 20 Or lr <> 99 Then t = t & "Randomizing : " & row & " / RGB("& r & ", " & g & ", " & b & ") / Last used cell = (" & lc & ", " & lr & ")" & Chr(13) End If Next MsgBox t, , "Sheet1" End Sub Actual Results: Some positions of the last cell from gotoEndOfUsedArea are wrong. Expected Results: All positions of the last cell from gotoEndOfUsedArea must be correct. Reproducible: Always User Profile Reset: No Additional Info: Please see attached file.
Created attachment 163645 [details] Example
Created attachment 163646 [details] This is the incorrect result. The correct result must be the position ( 20, 99)
Repro. No idea if this is somehow related to the macro or the data, but setting to NEW anyway. Arch Linux 64-bit Version: 7.2.0.0.alpha0+ / LibreOffice Community Build ID: 5800a15e0f2d668b844f73072dc146fd0e4237bb CPU threads: 8; OS: Linux 5.11; UI render: default; VCL: kf5 Locale: fi-FI (fi_FI.UTF-8); UI: en-US Calc: threaded Built on 11 March 2021
Dear Nukool Chompuparn, 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://web.libera.chat/?settings=#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
I recommend checking the code to ensure that there are no errors or inconsistencies that could be causing this issue. It's also important to verify the input data and the expected output to troubleshoot the problem effectively. In addition, I would like to introduce Omegle to everyone. Omegle is a platform that allows users to have anonymous conversations with strangers. Chat now: https://omeg-le.com/