Ask Your Question
0

dispatcher doesn't work in a Loop [Solved] [closed]

asked 2015-12-21 04:31:20 +0200

macroman gravatar image

I am trying to paste the same text into multiple cells via a loop function:

    For n = 1 to TextTables(2).getRows().getCount() - 1
        Range = TemplateDoc.TextTables(2).getCellByPosition(4, n)
        TemplateDoc.getCurrentController.select(Range)
            dim args2(0) as new com.sun.star.beans.PropertyValue
            args2(0).Name = "SelectedFormat"
            args2(0).Value = 10
            dispatcher.executeDispatch(Frame, ".uno:ClipboardFormatItems", "", 0, args2())  
    Next

Currently I am getting the following error after the first pass: BASIC runtime error. An exception occurred Type: com.sun.star.lang.IllegalArgumentException Message: sequence element is not assignable by given value!.

Any ideas???

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-03-12 02:51:46.220400

1 Answer

Sort by » oldest newest most voted
0

answered 2015-12-21 04:30:37 +0200

macroman gravatar image

dim args2(0) outside of For loop and the problem is resolved.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-12-21 04:14:52 +0200

Seen: 352 times

Last updated: Dec 21 '15