简体   繁体   中英

xlsopen doesn't work in windows 10 Octave 4.0.3

I am trying to run just the simple code

f = xlsopen('Libro1.xlsx');

am using octave 4.0.3 in Windows 10, java version 8 update 111 1.8.0_111-b14

From what I have found out so far have:
already uninstalled it, and installed it again,
made sure no non ASCII characters are in the path,
latest java version is installed (not that it matters? supposedly the octave windows installer installs you a version for it)
loaded both windows and io pkgs
io version 2.4.3 and windows version 1.2.4
and am still receiving this error:

warning: fopen: 'C:/Users/tommy/Documents/Octave\\Libro1.xlsx' found by searching load path warning: called from xlsopen at line 241 column 7 xlsread at line 197 column 11 prueba4 at line 2 column 3 Detected XLS interfaces: COM*; warning: No Java support found (no Java JRE? no Java pkg installed AND loaded?)

warning: ActiveX error trying to open or create file C:\\Users\\tommy\\Libro1.xlsx warning: COM_spsh_open : some elements in list of return values are undefined file Libro1.xlsx couldn't be unpacked. Is it the proper file format? warning: OCT_spsh_open : some elements in list of return values are undefined None. warning: xlsopen.m: no'.xlsx' spreadsheet I/O support with available interfaces. warning: xlsread: some elements in list of return values are undefined d =

Have seen various threads, even one that has the exact same message but, either installing java solved it, or another solution was found but not reported on the thread.

Edit: Only relevant for Octave version < 3.8.0

I would put this as a comment, but I don't have enough reputation

Octave java-enabled

Check the output of (from an Octave console) to determine whether you have a Java-capable installation of Octave

octave_config_info ("features").JAVA

It should return ans = 1

Check JAVA_HOME

And check your JAVA_HOME environment variable

getenv('JAVA_HOME')

This should be the path to your JRE (eg ans = C:\\Program Files\\Java\\jre1.8.0_91 )

Compatible architecture

Is Octave built for the same architecture as the JRE?

From command-line run

java -version

If it says '64-bit' anywhere, it's 64-bit, otherwise it's 32-bit.

From the Octave terminal

octave_config_info('CC')
ans = x86_64-w64-mingw32-gcc

Means Octave it was compiled for 64-bit.

A new Octave session will also display the information Octave was configured for "x86_64-w64-mingw32" for the 64-bit version found on the unofficial file list ( I don't have 32-bit installed, so I can't confirm what the message would be if it's 32-bit ).

First: I only see warnings in your posting (no errors) from probing the several interfaces and I guess xlsopen automatically used the OCT interface and f is valid afterwards. There are several interfaces to read xlsx using the io package. See here . I would suggest the OCT interface which doesn't have dependencies. If you really want a java based interface you've to install a JRE or JDK, have an Octave with java support installed.

EDIT: Now I see that your file Libro1.xlsx isn't located in your working directory and it looks like you've used addpath to add the folder where your Libro1.xlsx is located thus the "warning: fopen: 'C:/Users/tommy/Documents/Octave\\Libro1.xlsx' found by searching load path".

But "addpath" isn't thought to add directories for fopen. Either cd to the directory where your Libro1.xlsx is located (so that you see it listed when executing ls ) or create a full filename with fullfile and use this in xlsopen

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM