waar zit de fout

gevraagd 2019-06-11 10:22:56 +0200

vuurdraken gravatar image

updated 2019-06-14 18:02:40 +0200

ik heb dit geschreven maar de datum word er niet bij geschreven wat doe ik hier verkeert


sub copy() 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 = "Nr" args1(0).Value = 5

dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args1())

rem ---------------------------------------------------------------------- dim args2(0) as new com.sun.star.beans.PropertyValue args2(0).Name = "Bookmark" args2(0).Value = "C660"

dispatcher.executeDispatch(document, ".uno:JumpToMark", "", 0, args2())

rem ---------------------------------------------------------------------- rem dispatcher.executeDispatch(document, ".uno:OpenHyperlink", "", 0, Array())

rem ---------------------------------------------------------------------- dim args4(0) as new com.sun.star.beans.PropertyValue args4(0).Name = "ToPoint" args4(0).Value = "$D$3:$F$692"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args4())

rem ---------------------------------------------------------------------- dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())

rem ---------------------------------------------------------------------- dim args6(0) as new com.sun.star.beans.PropertyValue args6(0).Name = "Nr" args6(0).Value = 7

dispatcher.executeDispatch(document, ".uno:JumpToTable", "", 0, args6())

rem ---------------------------------------------------------------------- dim args7(5) as new com.sun.star.beans.PropertyValue args7(0).Name = "Flags" args7(0).Value = "SVD" args7(1).Name = "FormulaCommand" args7(1).Value = 0 args7(2).Name = "SkipEmptyCells" args7(2).Value = false args7(3).Name = "Transpose" args7(3).Value = false args7(4).Name = "AsLink" args7(4).Value = false args7(5).Name = "MoveMode" args7(5).Value = 4

dispatcher.executeDispatch(document, ".uno:InsertContents", "", 0, args7())

rem ---------------------------------------------------------------------- dispatcher.executeDispatch(document, ".uno:InsertColumnsBefore", "", 0, Array())

rem ---------------------------------------------------------------------- dim args9(0) as new com.sun.star.beans.PropertyValue args9(0).Name = "ToPoint" args9(0).Value = "$H$6"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args9())

rem ---------------------------------------------------------------------- dim args10(0) as new com.sun.star.beans.PropertyValue args10(0).Name = "ToPoint" args10(0).Value = "$I$6"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args10())

end sub

van af hier loop het vastde code hier onder werk als ik deze los heb staan maar wil ze aan elkaar hebben**

sub datum() 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 = "$A$2"

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 = "$M$2"

dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args3())

rem ---------------------------------------------------------------------- dim args4(5) as new com.sun.star.beans.PropertyValue args4(0).Name = "Flags" args4(0).Value = "D" 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" args4(5).Value = 4

dispatcher.executeDispatch(document, ".uno:InsertContents", "", 0, args4())

rem ---------------------------------------------------------------------- dim args5(0) as new com.sun.star.beans.PropertyValue args5(0).Name ... (meer)

bewerken retag markeer ongewenst sluiten samenvoegen verwijderen

Commentaren

de wijze waarop de code hier is neergezet is het niet heel erg makkelijk de code te lezen... als je stap voor stap door de code gaat waar loopt je dan vast?

rwestein gravatar imagerwestein ( 2019-06-14 07:53:17 +0200 )bewerken

Het wordt er niet echt duidelijker op... ik zie wel dat Sub datum() niet word aangeroepen. Als de twee subs achter elkaar moeten lopen dan kan je er het beste 1 sub van maken...

rwestein gravatar imagerwestein ( 2019-06-14 23:59:18 +0200 )bewerken