Excel и LibreOffice поддерживают запись макросов в виде программ на языке Basic. После записи
можно редактировать.
Пример записанного скрипта в Excel:
```text
Sub Sample()
ActiveCell.FormulaR1C1 = "1"
Range("A2").Select
ActiveCell.FormulaR1C1 = "2"
Range("A1:A2").Select
Selection.AutoFill Destination:=Range("A1:A10"), Type:=xlFillDefault
Range("A1:A10").Select
Range("B1").Select
End Sub
```
Пример записанного скрипта в LibreOffice (те же действия):
```text
sub Sample
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 = "StringName"
args1(0).Value = "1"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args1())
dispatcher.executeDispatch(document, ".uno:JumpToNextCell", "", 0, Array())
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "StringName"
args3(0).Value = "2"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args3())
dispatcher.executeDispatch(document, ".uno:JumpToNextCell", "", 0, Array())
dim args7(0) as new com.sun.star.beans.PropertyValue
args7(0).Name = "By"
args7(0).Value = 1
dispatcher.executeDispatch(document, ".uno:GoDownSel", "", 0, args7())
dim args8(0) as new com.sun.star.beans.PropertyValue
args8(0).Name = "EndCell"
args8(0).Value = "R10C1"
dispatcher.executeDispatch(document, ".uno:AutoFill", "", 0, args8())
dim args12(1) as new com.sun.star.beans.PropertyValue
args12(0).Name = "By"
args12(0).Value = 1
args12(1).Name = "Sel"
args12(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, args12())