I managed to get something working but I wonder if it needs to be cleaned up. Any thoughts on my code below?
sub copy
rem ----------------------------------------------------------------------
rem define variables
GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")
dim document as object
dim dispatcher as object
dim oDocA As Object, oDocB As Object, oSheetA As Object, Dummy(), oRangeA as object, targetcell as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
Set oDocA = CreateScriptService("Document", "book2.ods")
oDocA.Activate()
oDispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
oDocA = ThisComponent
oFrameA = oDocA.CurrentController.Frame
oSheetA = oDocA.getSheets.getByIndex(0)
oRangeA = oSheetA.getCellRangeByName("A1:B2")
oDocA.CurrentController.Select(oRangeA)
oDispatcher.executeDispatch(oFrameA, ".uno:Copy", "", 0, Dummy())
rem ----------------------------------------------------------------------
Set oDocB = CreateScriptService("Document", "book1.ods")
oDocB.Activate()
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = "$A$4"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
end sub