Bug 74118 - pb with "sheets.insertByName" function
Summary: pb with "sheets.insertByName" function
Status: RESOLVED DUPLICATE of bug 70079
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.1.4.2 release
Hardware: x86 (IA32) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-27 15:27 UTC by vincent.diguet
Modified: 2014-02-05 22:25 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
example of "sheets.inserByName" function (11.14 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-01-27 15:27 UTC, vincent.diguet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vincent.diguet 2014-01-27 15:27:00 UTC
Created attachment 92864 [details]
example of "sheets.inserByName" function

Hello, 

following the use of the function 'sheets.insertByName' I've realized it didn't work properly or at least differently from OpenOffice 

  example code 
Set oSheet2 = objDocument.createInstance ("com.sun.star.sheet.Spreadsheet") 
objDocument.Sheets.insertByName "ListField" oSheet2 
set ocell oSheet2.getCellRangeByName = ("A1") 
oCell.setString ("Field1") 

In fact, instead of writing "Field1" in cell A1 of the "ListField" sheet, it writes "Field1"  in cell "A1" of sheet "Sheet1" 

To write properly in the "LisftField" sheet, I must use this code : 
Set oSheet2 = objDocument.createInstance ("com.sun.star.sheet.Spreadsheet") 
objDocument.Sheets.insertByName "ListField" oSheet2 
set oSheet2 objDocument.getSheets = (). getByName ("ListField") 
set ocell oSheet2.getCellRangeByName = ("A1") 
oCell.setString ("Field1")

vd
Comment 1 Julien Nabet 2014-01-27 22:52:32 UTC
On pc Debian x86-64 with master sources updated yesterday, I can reproduce this.

Noel: any idea/code pointer?
Comment 2 Noel Power 2014-02-03 11:44:22 UTC

*** This bug has been marked as a duplicate of bug 70079 ***
Comment 3 Noel Power 2014-02-03 12:12:27 UTC
(In reply to comment #1)
> On pc Debian x86-64 with master sources updated yesterday, I can reproduce
> this.
> 
> Noel: any idea/code pointer?

could you try with patch from bug # 70009 (sorry don't have much time these days for libreoffice)
Comment 4 Julien Nabet 2014-02-04 17:53:50 UTC
Noel: I git updated today (so it included http://cgit.freedesktop.org/libreoffice/core/commit/?id=8eec79e595eb651cd41e2f6a1918af67c4d43cf7) and built, I still got have the problem.
Comment 5 Noel Power 2014-02-05 12:48:04 UTC
(In reply to comment #4)
> Noel: I git updated today (so it included
> http://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=8eec79e595eb651cd41e2f6a1918af67c4d43cf7) and built, I still got have
> the problem.

are you sure?, I was fairly positive that this was the same issue and I tried here again last night, seemed to me to work, e.g. ran the macro and ListField:A1 gets updated whereas without the patch the current sheet was getting updated. I've deleted that tree again now to free up space for other tasks, be grate if you can try confirm again
Comment 6 Julien Nabet 2014-02-05 19:59:04 UTC
Noel: oups you're right, I had done it wrong. WFM.