2010/3/3 khobbos khobbos <[email protected]>: > > > > > > > > > > > > > > > > > > Dear > sir > I > want to make a macro in calc 3.1 > > > > Simply > > > I > wrote a formula in cell NB (A1) > I > want to jump to cell NB (A3) and paste the same > > > > > So I record this macro and > everything goes well > sub > Main13 > 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 > ---------------------------------------------------------------------- > dispatcher.executeDispatch(document, > ".uno:Copy", "", 0, Array()) > rem > ---------------------------------------------------------------------- > dim > args2(1) as new com.sun.star.beans.PropertyValue > args2(0).Name > = "By" > args2(0).Value > = 1 > args2(1).Name > = "Sel" > args2(1).Value > = false > dispatcher.executeDispatch(document, > ".uno:GoDown", "", 0, args2()) > rem > ---------------------------------------------------------------------- > dim > args3(1) as new com.sun.star.beans.PropertyValue > args3(0).Name > = "By" > args3(0).Value > = 1 > args3(1).Name > = "Sel" > args3(1).Value > = false > dispatcher.executeDispatch(document, > ".uno:GoDown", "", 0, args3()) > rem > ---------------------------------------------------------------------- > dispatcher.executeDispatch(document, > ".uno:Paste", "", 0, Array()) > > end sub > > now I need to do a loop so I can > for example repeat the same 10 times > > after googling I found this > lines > Dim > I > For > I = 1 to 10 > ‘… > Inner part of loop > Next > I > > So I edit the macro in this way > sub > Main13 > 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") > dim > i > for > i = 1 to 2 > rem > ---------------------------------------------------------------------- > dispatcher.executeDispatch(document, > ".uno:Copy", "", 0, Array()) > rem > ---------------------------------------------------------------------- > dim > args2(1) as new com.sun.star.beans.PropertyValue > args2(0).Name > = "By" > args2(0).Value > = 1 > args2(1).Name > = "Sel" > args2(1).Value > = false > dispatcher.executeDispatch(document, > ".uno:GoDown", "", 0, args2()) > rem > ---------------------------------------------------------------------- > dim > args3(1) as new com.sun.star.beans.PropertyValue > args3(0).Name > = "By" > args3(0).Value > = 1 > args3(1).Name > = "Sel" > args3(1).Value > = false > dispatcher.executeDispatch(document, > ".uno:GoDown", "", 0, args3()) > rem > ---------------------------------------------------------------------- > dispatcher.executeDispatch(document, > ".uno:Paste", "", 0, Array()) > next > i > > end sub > now > I am getting this message : sequence element is not assignable by > given value! > > > > > > > So > plz can any one help me with this > > > > > Many > thanks > > > > Regard’s > _________________________________________________________________ > Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. > https://signup.live.com/signup.aspx?id=60969
What does NB mean? I have only one advice: Never use the crappy macro recorder. It's quite useless. There is a slightly better one somewhere to install, if you like, I guess someone else can tell you exactly where to find it. Regards Johnny Rosenberg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
