von Stephan » Fr, 01.02.2019 20:30
das kann man (größtenteils) mit dem Makrorekorder aufzeichnen:
Code: Alles auswählen
sub drag_formula()
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")
With ThisComponent
.CurrentController.setActiveSheet(.Sheets.getByName("Planilha1"))
End With
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = "$A$2"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())
rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "EndCell"
args3(0).Value = "$A$3000"
dispatcher.executeDispatch(document, ".uno:AutoFill", "", 0, args3())
end Sub
Gruß
Stephan
das kann man (größtenteils) mit dem Makrorekorder aufzeichnen:
[code]sub drag_formula()
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")
With ThisComponent
.CurrentController.setActiveSheet(.Sheets.getByName("Planilha1"))
End With
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = "$A$2"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())
rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "EndCell"
args3(0).Value = "$A$3000"
dispatcher.executeDispatch(document, ".uno:AutoFill", "", 0, args3())
end Sub[/code]
Gruß
Stephan