[Libreoffice-bugs] [Bug 122980] New: Macro does not execute as recorded

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Jan 25 19:53:27 UTC 2019


https://bugs.documentfoundation.org/show_bug.cgi?id=122980

            Bug ID: 122980
           Summary: Macro does not execute as recorded
           Product: LibreOffice
           Version: 6.1.4.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: roger.millichamp at virgin.net

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20190125/295b57db/attachment-0001.html>


More information about the Libreoffice-bugs mailing list