Issue 20199 - selects wrong spreadsheet from a macro
Summary: selects wrong spreadsheet from a macro
Status: CLOSED NOT_AN_OOO_ISSUE
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: OOo 1.1 RC5
Hardware: Other Linux, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: joerg.skottke
QA Contact: issues@sc
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-26 15:58 UTC by Unknown
Modified: 2013-08-07 15:15 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Unknown 2003-09-26 15:58:38 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>
Comment 1 frank 2003-09-26 16:34:51 UTC
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

Comment 2 niklas.nebel 2003-09-26 16:44:55 UTC
I can't even reproduce any problems. Jörg, you should take a look.
Comment 3 Unknown 2003-09-30 14:21:59 UTC
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 
Comment 4 oc 2003-10-08 11:47:27 UTC
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.
Comment 5 joerg.skottke 2004-06-14 11:38:55 UTC
close