gute Nachricht. die Eingabemaske "Kunden" habe ich per "Makro aufzeichnen" hingekriegt.
Mein Problem ist "nur" noch, daß mir die nächstgrößere Kundennummer angezeigt bzw. eingetragen wird.
Unten der code. An welcher Stelle muß was geändert werden
Code: Alles auswählen
sub Main
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 = "$E$11"
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 = "Nr"
args3(0).Value = 1
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args3())
rem ----------------------------------------------------------------------
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "ToPoint"
args4(0).Value = "$A$6"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args4())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
rem ----------------------------------------------------------------------
dim args6(0) as new com.sun.star.beans.PropertyValue
args6(0).Name = "Nr"
args6(0).Value = 2
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args6())
rem ----------------------------------------------------------------------
dim args7(0) as new com.sun.star.beans.PropertyValue
args7(0).Name = "ToPoint"
args7(0).Value = "$E$13"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args7())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem ----------------------------------------------------------------------
dim args9(0) as new com.sun.star.beans.PropertyValue
args9(0).Name = "Nr"
args9(0).Value = 1
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args9())
rem ----------------------------------------------------------------------
dim args10(0) as new com.sun.star.beans.PropertyValue
args10(0).Name = "ToPoint"
args10(0).Value = "$B$6"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args10())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
rem ----------------------------------------------------------------------
dim args12(0) as new com.sun.star.beans.PropertyValue
args12(0).Name = "Nr"
args12(0).Value = 2
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args12())
rem ----------------------------------------------------------------------
dim args13(0) as new com.sun.star.beans.PropertyValue
args13(0).Name = "ToPoint"
args13(0).Value = "$E$15"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args13())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem ----------------------------------------------------------------------
dim args15(0) as new com.sun.star.beans.PropertyValue
args15(0).Name = "Nr"
args15(0).Value = 1
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args15())
rem ----------------------------------------------------------------------
dim args16(0) as new com.sun.star.beans.PropertyValue
args16(0).Name = "ToPoint"
args16(0).Value = "$C$6"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args16())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
rem ----------------------------------------------------------------------
dim args18(0) as new com.sun.star.beans.PropertyValue
args18(0).Name = "Nr"
args18(0).Value = 2
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args18())
rem ----------------------------------------------------------------------
dim args19(0) as new com.sun.star.beans.PropertyValue
args19(0).Name = "ToPoint"
args19(0).Value = "$E$17"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args19())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem ----------------------------------------------------------------------
dim args21(0) as new com.sun.star.beans.PropertyValue
args21(0).Name = "Nr"
args21(0).Value = 1
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args21())
rem ----------------------------------------------------------------------
dim args22(0) as new com.sun.star.beans.PropertyValue
args22(0).Name = "ToPoint"
args22(0).Value = "$D$6"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args22())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
rem ----------------------------------------------------------------------
dim args24(0) as new com.sun.star.beans.PropertyValue
args24(0).Name = "Nr"
args24(0).Value = 2
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args24())
rem ----------------------------------------------------------------------
dim args25(0) as new com.sun.star.beans.PropertyValue
args25(0).Name = "ToPoint"
args25(0).Value = "$E$19"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args25())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem ----------------------------------------------------------------------
dim args27(0) as new com.sun.star.beans.PropertyValue
args27(0).Name = "Nr"
args27(0).Value = 1
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args27())
rem ----------------------------------------------------------------------
dim args28(0) as new com.sun.star.beans.PropertyValue
args28(0).Name = "ToPoint"
args28(0).Value = "$E$6"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args28())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
rem ----------------------------------------------------------------------
dim args30(0) as new com.sun.star.beans.PropertyValue
args30(0).Name = "Nr"
args30(0).Value = 2
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args30())
rem ----------------------------------------------------------------------
dim args31(0) as new com.sun.star.beans.PropertyValue
args31(0).Name = "ToPoint"
args31(0).Value = "$E$21"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args31())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem ----------------------------------------------------------------------
dim args33(0) as new com.sun.star.beans.PropertyValue
args33(0).Name = "Nr"
args33(0).Value = 1
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args33())
rem ----------------------------------------------------------------------
dim args34(0) as new com.sun.star.beans.PropertyValue
args34(0).Name = "ToPoint"
args34(0).Value = "$F$6"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args34())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
rem ----------------------------------------------------------------------
dim args36(0) as new com.sun.star.beans.PropertyValue
args36(0).Name = "Nr"
args36(0).Value = 2
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args36())
rem ----------------------------------------------------------------------
dim args37(0) as new com.sun.star.beans.PropertyValue
args37(0).Name = "ToPoint"
args37(0).Value = "$E$23"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args37())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem ----------------------------------------------------------------------
dim args39(0) as new com.sun.star.beans.PropertyValue
args39(0).Name = "Nr"
args39(0).Value = 1
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args39())
rem ----------------------------------------------------------------------
dim args40(0) as new com.sun.star.beans.PropertyValue
args40(0).Name = "ToPoint"
args40(0).Value = "$G$6"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args40())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
rem ----------------------------------------------------------------------
dim args42(0) as new com.sun.star.beans.PropertyValue
args42(0).Name = "Nr"
args42(0).Value = 2
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args42())
rem ----------------------------------------------------------------------
dim args43(0) as new com.sun.star.beans.PropertyValue
args43(0).Name = "ToPoint"
args43(0).Value = "$E$25"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args43())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem ----------------------------------------------------------------------
dim args45(0) as new com.sun.star.beans.PropertyValue
args45(0).Name = "Nr"
args45(0).Value = 1
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args45())
rem ----------------------------------------------------------------------
dim args46(0) as new com.sun.star.beans.PropertyValue
args46(0).Name = "ToPoint"
args46(0).Value = "$H$6"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args46())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
rem ----------------------------------------------------------------------
dim args48(0) as new com.sun.star.beans.PropertyValue
args48(0).Name = "Nr"
args48(0).Value = 2
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args48())
rem ----------------------------------------------------------------------
dim args49(0) as new com.sun.star.beans.PropertyValue
args49(0).Name = "ToPoint"
args49(0).Value = "$E$27"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args49())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem ----------------------------------------------------------------------
dim args51(0) as new com.sun.star.beans.PropertyValue
args51(0).Name = "Nr"
args51(0).Value = 1
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args51())
rem ----------------------------------------------------------------------
dim args52(0) as new com.sun.star.beans.PropertyValue
args52(0).Name = "ToPoint"
args52(0).Value = "$I$6"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args52())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
rem ----------------------------------------------------------------------
dim args54(0) as new com.sun.star.beans.PropertyValue
args54(0).Name = "Nr"
args54(0).Value = 2
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args54())
rem ----------------------------------------------------------------------
dim args55(0) as new com.sun.star.beans.PropertyValue
args55(0).Name = "ToPoint"
args55(0).Value = "$E$29"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args55())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem ----------------------------------------------------------------------
dim args57(0) as new com.sun.star.beans.PropertyValue
args57(0).Name = "Nr"
args57(0).Value = 1
dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args57())
rem ----------------------------------------------------------------------
dim args58(0) as new com.sun.star.beans.PropertyValue
args58(0).Name = "ToPoint"
args58(0).Value = "$J$6"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args58())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:InsertRows", "", 0, Array())
end sub
sub Neu
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 = "$E$11"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "Flags"
args2(0).Value = "SVDFN"
dispatcher.executeDispatch(document, ".uno:Delete", "", 0, args2())
rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "ToPoint"
args3(0).Value = "$E$13"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args3())
rem ----------------------------------------------------------------------
dim args4(0) as new com.sun.star.beans.PropertyValue
args4(0).Name = "Flags"
args4(0).Value = "SVDFN"
dispatcher.executeDispatch(document, ".uno:Delete", "", 0, args4())
rem ----------------------------------------------------------------------
dim args5(0) as new com.sun.star.beans.PropertyValue
args5(0).Name = "ToPoint"
args5(0).Value = "$E$15"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args5())
rem ----------------------------------------------------------------------
dim args6(0) as new com.sun.star.beans.PropertyValue
args6(0).Name = "Flags"
args6(0).Value = "SVDFN"
dispatcher.executeDispatch(document, ".uno:Delete", "", 0, args6())
rem ----------------------------------------------------------------------
dim args7(0) as new com.sun.star.beans.PropertyValue
args7(0).Name = "ToPoint"
args7(0).Value = "$E$17"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args7())
rem ----------------------------------------------------------------------
dim args8(0) as new com.sun.star.beans.PropertyValue
args8(0).Name = "Flags"
args8(0).Value = "SVDFN"
dispatcher.executeDispatch(document, ".uno:Delete", "", 0, args8())
rem ----------------------------------------------------------------------
dim args9(0) as new com.sun.star.beans.PropertyValue
args9(0).Name = "ToPoint"
args9(0).Value = "$E$19"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args9())
rem ----------------------------------------------------------------------
dim args10(0) as new com.sun.star.beans.PropertyValue
args10(0).Name = "Flags"
args10(0).Value = "SVDFN"
dispatcher.executeDispatch(document, ".uno:Delete", "", 0, args10())
rem ----------------------------------------------------------------------
dim args11(0) as new com.sun.star.beans.PropertyValue
args11(0).Name = "ToPoint"
args11(0).Value = "$E$21"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args11())
rem ----------------------------------------------------------------------
dim args12(0) as new com.sun.star.beans.PropertyValue
args12(0).Name = "Flags"
args12(0).Value = "SVDFN"
dispatcher.executeDispatch(document, ".uno:Delete", "", 0, args12())
rem ----------------------------------------------------------------------
dim args13(0) as new com.sun.star.beans.PropertyValue
args13(0).Name = "ToPoint"
args13(0).Value = "$E$23"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args13())
rem ----------------------------------------------------------------------
dim args14(0) as new com.sun.star.beans.PropertyValue
args14(0).Name = "Flags"
args14(0).Value = "SVDFN"
dispatcher.executeDispatch(document, ".uno:Delete", "", 0, args14())
rem ----------------------------------------------------------------------
dim args15(0) as new com.sun.star.beans.PropertyValue
args15(0).Name = "ToPoint"
args15(0).Value = "$E$25"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args15())
rem ----------------------------------------------------------------------
dim args16(0) as new com.sun.star.beans.PropertyValue
args16(0).Name = "Flags"
args16(0).Value = "SVDFN"
dispatcher.executeDispatch(document, ".uno:Delete", "", 0, args16())
rem ----------------------------------------------------------------------
dim args17(0) as new com.sun.star.beans.PropertyValue
args17(0).Name = "ToPoint"
args17(0).Value = "$E$27"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args17())
rem ----------------------------------------------------------------------
dim args18(0) as new com.sun.star.beans.PropertyValue
args18(0).Name = "Flags"
args18(0).Value = "SVDFN"
dispatcher.executeDispatch(document, ".uno:Delete", "", 0, args18())
rem ----------------------------------------------------------------------
dim args19(0) as new com.sun.star.beans.PropertyValue
args19(0).Name = "ToPoint"
args19(0).Value = "$E$29"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args19())
rem ----------------------------------------------------------------------
dim args20(0) as new com.sun.star.beans.PropertyValue
args20(0).Name = "Flags"
args20(0).Value = "SVDFN"
dispatcher.executeDispatch(document, ".uno:Delete", "", 0, args20())
rem ----------------------------------------------------------------------
dim args21(0) as new com.sun.star.beans.PropertyValue
args21(0).Name = "ToPoint"
args21(0).Value = "$E$11"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args21())
end sub