Apache OpenOffice (AOO) Bugzilla – Issue 20199
selects wrong spreadsheet from a macro
Last modified: 2013-08-07 15:15:18 UTC
With OOo runing and a spreadsheet open - run the macro below(substituting a valid spreadsheet file name), it opens a spreadsheet and then selects sheet1:A1 to bring the sheet into focus. This works on OOo 1.0.2 but on OOo 1.1RC5 the spreadsheet that was already open is selected instead(about 80% of the time). This causes the rest of the macro to fail. When I added the line: wait 2000 the proper selection was made every time. Perhaps the line: oSourceDoc=oDesk.loadComponentFromURL(sUrl,"_blank",0,NoArg()) returns before the spreadsheet has the focus and as a result the original spreadsheet is selected by the lines following. I commented the wait line so that it would be in failure mode if copied and run. The code below <snip> sUrl = "File:///home/sxc/challenge.sxc" if (fileexists (sUrl)) <> 0 then 'open spreadsheet. oDesk = createUnoService("com.sun.star.frame.Desktop") Dim NoArg() oSourceDoc=oDesk.loadComponentFromURL(sUrl,"_blank",0,NoArg()) rem wait 2000 oSourceSheet= oSourceDoc.Sheets(0) oSourceRange = oSourceSheet.getCellRangeByPosition(0,0,0,0) ThisComponent.CurrentController.Select(oSourceRange) else exit sub end if <snip>
Hi, The Prio is mutch to high, Prio 3 is more sufficient. Prio1 means the whole Application is broken. This is not the case, also a workaround is available. Hi Niklas, your construction site ? 1.1.1 because this is maybe affects some enterprises. Frank
I can't even reproduce any problems. Jörg, you should take a look.
For the line ThisComponent.CurrentController.Select(oSourceRange) that oSourceDoc shoud be used instead of ThisComponent. Therefore I believe that the problem I reported is now invalid. David
According to the roadmap of OpenOffice.org 1.1 (http://tools.openoffice.org/releases/Openoffice_org_1_x.html) this issue has been scheduled for 1.1.2.
close