bugGNU Octave - Bugs: bug #42028, Error in xlswrite in package io

 
 

bug #42028: Error in xlswrite in package io

Submitted by:  None
Submitted on:  Wed 02 Apr 2014 08:37:38 AM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: FerneyOriginator Email: -unavailable-
Open/Closed: ClosedRelease: other
Operating System: Microsoft Windows

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 02 Apr 2014 07:59:14 PM UTC, comment #1:

You're right in your analysis.
Moreover, in L.156 of xlsopen.m, xlsintf_cnt should be set to 0 rather than 1, as well.

But:
This part of the code has already been commented out in svn and in my dev version of io-2.1.0, as the OCT interface now has full write support for .xlsx (and .ods).

(My plan is/was to release "stable" io-2.2.0 as soon as there's also sufficiently mature .gnumeric write support, but I haven't found time to even make a start on that.

I'll discuss with the other io dev/.xlsx write support creator, Markus, whether an io-2.2.0 w/o .gnumeric write support would be a good idea.
xlsx write support with the OCT interface hasn't received much testing. Would you like to volunteer? drop me an email)

Philip Nienhuis <philipnienhuis>
Project Member
Wed 02 Apr 2014 08:37:38 AM UTC, original submission:

I was trying to use the xlswrite function from the IO package(ver 2.0.2)to write the array 'main'(6x4) into the range 'A4:D9' on the worksheet 'wfm' of the excel file 'try.xlsx'

I have available COM interface only. It's working, as checked with:

">> chk_spreadsheet_support
ans = 1"

However, it gave me the following error message:

"xlswrite('try.xlsx' , main, 'wfm','a4:d9')
error: Only the OCT interface is present | requested, but that has only read support
error: called from:
error: C:\Users\FJX023\Documents\Software\octave\octave-3.8.1\share\octave\packages\io-2.0.2\xlsopen.m at line 265, colu
mn 7
error: C:\Users\FJX023\Documents\Software\octave\octave-3.8.1\share\octave\packages\io-2.0.2\xlswrite.m at line 174, col
umn 9"

The error message would mean that no interface is available, although the check says COM is working!

I checked the line 265 of the xlsopen.m file to see what it was doing, and I found this:

263 ## Catch attempts to write xlsx if only OCT interface is supported
264 if (xlsintf_cnt == 1 && xlsinterfaces.OCT)
265 error ("Only the OCT interface is present | requested, but that has only read support");
266 endif

I considered that it's a typo, as if xlsint_cnt<>0, it means there is at least one interface allowing writing xls files. Therefore, I modified it to be:

264 if (xlsintf_cnt == 0 && xlsinterfaces.OCT)

It did the trick. I could make it write in the xls file, but I don't know if I'm right or it was merely luck.

Thx,

Ferney

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 02 Apr 2014 07:59:14 PM UTCphilipnienhuisItem GroupNone=>Incorrect Result
      StatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Release3.8.1=>other

    Back to the top


    Powered by Savane 3.1-cleanup1