(Vielleicht interessiert das wen, heute oder wer künftig mit ähnlich dürftigem Vorwissen an so etwas heran geht.)
(Der Makrorekorder ist doch für vieles fast alternativlos, wenn man mal herausgefunden hat, wann der was tut und was im UI an ihm vorbei geht.)
·
Code: Alles auswählen
sub recorded
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 = "Grafikseite24_03"
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 = "Grafikseite24_04"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args3())
rem ---------------------------------------------------------------------- ' cf. Pitonyak et al. 16.5.4/5, pgs. 522-524
dim args4(5) as new com.sun.star.beans.PropertyValue ' com.sun.star.sheet.CellFlags ↑ 16.4.2 pg. 497
args4(0).Name = "Flags" ' Formatierungen, Zahlen, Formeln, Text (Objekte: wirkungslos)
args4(0).Value = "SVFT" ' Styles, Values, Formula, Text
args4(1).Name = "FormulaCommand"
args4(1).Value = 0
args4(2).Name = "SkipEmptyCells"
args4(2).Value = false
args4(3).Name = "Transpose"
args4(3).Value = false
args4(4).Name = "AsLink"
args4(4).Value = false
args4(5).Name = "MoveMode" ' com.sun.star.sheet.CellInsertMode
args4(5).Value = 4 ' DOWN,RIGHT,UP,LEFT = 0,1,2,3 ??? = 4 (=NONE?)
dispatcher.executeDispatch(document, ".uno:InsertContents", "", 0, args4())
end sub
Und freilich auch das eigentliche neue (n+1.) Diagramm (aus dem bestehenden (n.) als Vorlage) erzeuge und anpasse.