Hi All,
I am trying to create a macro that will allow me to copy a cell to notepad (or an external program) so I don’t have to ctrl+c it each time. When i have recorded the macro it works fine, but after clearing the copied cell selection (for example selecting a different cell, entering data and pressing enter). The macro is no longer working.
A copy of the macro below:
sub CopyAdj
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 = "$I$6"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "ToPoint"
args3(0).Value = "$H$2"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args3())
end sub
Currently using LibreOffice Version: 5.4.7.2 (x64)
Any assistance would be greatly appreciated.
(Edited for better readability by @Lupp )