Description: I am trying to create a macro that deletes the contents all rows in a column except 1. When I record the macro the steps I take have the desired effect. When I run the macro no cells have their contents deleted. Steps to Reproduce: We are going to create and run a macro that deletes all rows in Column A except row 1 1. Create the spreadsheet a. Put a value in rows 1 and 2 of Column A 2. Record the macro a. Select the menu item: Tools -> Macros -> Record Macro b. Select the whole of Column A by selecting the column label c. Deselect cell A1 by Control+Left Mouse Click in the cell d. Select the menu item: Sheet -> Clear Cells. This opens the Delete Content dialogue e. In the dialogue select OK. The contents of cell A2 are deleted but cell A1 remains unchanged. This the required behaviour. f. Stop recording the macro g. Save the macro as desired. 3. Restore the Spreadsheet, put the deleted value back a. Put a value in cell A2 4. Execute the macro a. Select the menu item Tools ->Macros -> Run Macro… which opens the Macro Selector dialogue b. In the dialogue i. Select the macro saved in step 2g above ii. Select the Run button c. The contents of cell A2 are not deleted which is not what was recorded 5. View the macro code. a. Select the menu item Tools -> Edit Macros b. Select the Macro stored in step 2g above c. The code is in the Additional Information field below. Actual Results: The contents of cell A2 are not deleted Expected Results: The contents of cell A2 should be deleted because that is what the recorded steps did. Reproducible: Always User Profile Reset: No Additional Info: The code of the macro is as follows sub testdelete rem ---------------------------------------------------------------------- rem define variables dim document as object dim dispatcher as object rem ---------------------------------------------------------------------- rem get access to the document document = ThisComponent.CurrentController.Frame dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") rem ---------------------------------------------------------------------- dim args1(0) as new com.sun.star.beans.PropertyValue args1(0).Name = "Flags" args1(0).Value = "SVDFN" dispatcher.executeDispatch(document, ".uno:Delete", "", 0, args1()) end sub Help Info Version: 6.1.4.2 (x64) Build ID: 9d0f32d1f0b509096fd65e0d4bec26ddd1938fd3 CPU threads: 4; OS: Windows 10.0; UI render: default; Locale: en-GB (en_GB); Calc: CL
reproducible with Version: 6.1.5.1 (x64) Build-ID: f18954c1ba9116b85c32b6bdbc0188d3e0fd24c7 CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; Gebietsschema: de-DE (de_DE); Calc: macro recording does not save cell selections. btw: a better solution would be to use LO API, e.g.: Sub DeleteRange() Dim oDoc as Object Dim oSheet as Object Dim oRange as Object Dim nFlag as Long oDoc = ThisComponent oSheet = oDoc.getSheets().getByName("Sheet1") oRange = oSheet.getCellRangeByName("A2:A10") ' https://www.openoffice.org/api/docs/common/ref/com/sun/star/sheet/CellFlags.html nFlag = com.sun.star.sheet.CellFlags.VALUE +_ com.sun.star.sheet.CellFlags.STRING +_ com.sun.star.sheet.CellFlags.DATETIME oRange.clearContents(nFlag) End Sub
Dear roger.millichamp, 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
I guess that this can be NotABug per documentation. Because https://help.libreoffice.org/latest/en-US/text/shared/guide/macro_recording.html?DbPAR=SHARED explains Limitations of the macro recorder, including that selection cannot be made with mouse. Of course that's not satisfying, but we cannot ask a chnage there, because it was already explained that such changes are not possible unless macro recorder is completely rewritten. What you can do is record all with keyboard, starting from the 1st selection Edit-Select-Column etc.