[Libreoffice-bugs] [Bug 138525] New: CALC - Recording Cut Paste Cell Macro creates code written in wrong order causing it to fail
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Fri Nov 27 11:45:19 UTC 2020
https://bugs.documentfoundation.org/show_bug.cgi?id=138525
Bug ID: 138525
Summary: CALC - Recording Cut Paste Cell Macro creates code
written in wrong order causing it to fail
Product: LibreOffice
Version: 6.4.7.2 release
Hardware: All
OS: Windows (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: BASIC
Assignee: libreoffice-bugs at lists.freedesktop.org
Reporter: davegreenland at yahoo.co.uk
Hi
Macro recorded a simple cut and paste cell from one location to another. When
run it didn't work.
This was code created by the Macro recorder:
sub movetank
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 = "ToPoint"
args1(0).Value = "$C$8"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Cut", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
rem ----------------------------------------------------------------------
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "ToPoint"
args4(0).Value = "$I$10"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args4())
----------------------------------------------------------------------
----------------------------------------------------------------------
Note that the uno.Paste line is simply pasting the value back into it's origin.
It should be the last line of code.
Summary: Macro recorder issue in cell cut/paste. Recorder software inserting
Paste code before initiating the target cell address.
--
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/20201127/8eb8df31/attachment.htm>
More information about the Libreoffice-bugs
mailing list