bugGNU Octave - Bugs: bug #59176, [octave forge] (windows) COM...

 
 

bug #59176: [octave forge] (windows) COM object.Item(n) fails on further '.'-index (error `0x8002000e')

Submitter:  None
Submitted:  Fri 25 Sep 2020 09:56:39 AM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Unexpected Error or Warning
Status:  None Assigned to:  lostbard
Originator Name:  David Originator Email:  -email is unavailable-
Open/Closed:  * Open Release:  * 5.2.0
Operating System:  * Microsoft Windows Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 30 Sep 2020 01:48:41 AM UTC, comment #7: 

The class code looks very close to that used in the ov-java.h class, so might be able to come up with some example usage of that for java

John Donoghue <lostbard>
Group Member
Mon 28 Sep 2020 08:02:34 PM UTC, comment #6: 

Applying that patch does fix the issue in package

John Donoghue <lostbard>
Group Member
Mon 28 Sep 2020 12:37:28 PM UTC, comment #5: 

I will see what I can do, and will also try with the patch from bug #58953 to verify it fixes it.

John Donoghue <lostbard>
Group Member
Mon 28 Sep 2020 12:26:49 PM UTC, comment #4: 

If you look at the tree_index_expression::lvalue method in pt-idx.cc you'll see that it calls subsref on each element of an index expression.  That was done to handle the possibility of the expression including an END index.  But it's not the right thing to do and my latest patch for bug #58953 should avoid this problem.

Can you create an example class that shows the problem without requiring Windows or the COM object?  Then I could more easily verify that the problem is fixed for this case as well, not just the one we were addressing in bug #58953.

John W. Eaton <jwe>
Group administrator
Mon 28 Sep 2020 11:58:52 AM UTC, comment #3: 

eLibro.Worksheets(1).Name = 'page1'


also works.

The issue is that octave is calling each 'subobject' in turn:

So for:

eLibro.Worksheets.Item(1).Name = 'page1';

its doing separate subrefs to:

1. Get the worksheets property.
2. Get the Item property (fails in this case because the property expects an index)
3. Calls (1)
4. Sets the Name property to page.

Interrestingly running:

eLibro.Worksheets.Item(1).Name


works ok as it groups the subref call types into one operation call, allowing us to perform multiple operations like getting applying the index to the property.

But I am not sure why octave is giving single subref operations for assign vs getting the values. (at least for the parts of the operation that are just getting values)


John Donoghue <lostbard>
Group Member
Fri 25 Sep 2020 01:34:47 PM UTC, comment #2: 

set(eLibro.Worksheets.Item(1), 'Name', 'page1');

also works

John Donoghue <lostbard>
Group Member
Fri 25 Sep 2020 01:17:22 PM UTC, comment #1: 

Doing something like this also works:

ws = eLibro.Worksheets.Item(1);
ws.Name = 'page1';

So somewhere there its not handling the compound extraction of the worksheet to set the name.

John Donoghue <lostbard>
Group Member
Fri 25 Sep 2020 09:56:39 AM UTC, original submission:  

Hello everyone,

Frist of all I have to say that this is my first bug report ever so please be gentle with me.
The problem that I have detect is the next one, I have a code that has been done in Matlab (and it run well), but with Octave return an error

The code is the following:
eAplicacion = actxserver ('Excel.Application');
eLibro = eAplicacion.Workbooks.Open(abspath([cabeceraOut nombreTipo '.xlsx']));
eLibro.Worksheets.Item(1).Name = 'page1';

And the error this one:
error: com_get: property/method invocation on the COM object failed with error `0x8002000e'

So, I ran the debugger and I saw that If I put this:
eLibro.Worksheets(1).Name = 'page1'; instead of eLibro.Worksheets.Item(1).Name = 'page1';

There is no error, and everything goes fine. But the thing is according to Microsoft’s documentation (https://docs.microsoft.com/en-us/office/vba/api/excel.worksheets.item) both are equivalent.
So both would have to be correct right?

And, in advance, thanks you very much for your help.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by mmuetzel (Updated the item)
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-09-25 mmuetzel Summary[octave forge] (windows) COM object.Item(n) syntax fails (error `0x8002000e') [octave forge] (windows) COM object.Item(n) fails on further '.'-index (error `0x8002000e')
    2020-09-25 lostbard Assigned toNone lostbard
    2020-09-25 mmuetzel Carbon-CopyRemoved 102357 -
    2020-09-25 mmuetzel Summaryerror: com_get: property/method invocation on the COM object failed with error `0x8002000e' [octave forge] (windows) COM object.Item(n) syntax fails (error `0x8002000e')

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code