I have a macro which pretty much allows me to copy a range to a single cell on Calc, which I want to use on Base. But I do not know how to apply it towards a table on Base. I need help knowing where the table name goes. could it be possible to have the macro execute automatically? by default?
The macro is pretty much like this
Sub Main
End Sub
sub copyrangetosinglecell()
dim document as object dim dispatcher as object
document = ThisComponent.CurrentController.Frame
dispatcher =
createUnoService(“com.sun.star.frame.DispatchHelper”)
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = “ToPoint”
args1(0).Value = “$B$5:$E$5”
dispatcher.executeDispatch(document,
“.uno:GoToCell”, “”, 0, args1())dispatcher.executeDispatch(document,
“.uno:Copy”, “”, 0, Array())
dim args3(0) as new
com.sun.star.beans.PropertyValue
args3(0).Name = “ToPoint”
args3(0).Value = “$I$3”dispatcher.executeDispatch(document,
“.uno:GoToCell”, “”, 0, args3())
dispatcher.executeDispatch(document,
“.uno:SetInputMode”, “”, 0, Array())dispatcher.executeDispatch(document,
“.uno:Paste”, “”, 0, Array())dim args5(0) as new
com.sun.star.beans.PropertyValue
args5(0).Name = “ToPoint”
args5(0).Value = “$C$3”dispatcher.executeDispatch(document,
“.uno:GoToCell”, “”, 0, args5())end sub