Open .xls file with xlsread

Problem description

I need to read an excel file .xls but when I try to read it with xlsread, I get the following warning:

warning: xlsopen: no'.xls' spreadsheet I/O support with available interfaces.

Therfore every time I open the .xls file into Excel and save it as .xslx file. In this way xlsread is able to read the new .xlsx file.
How can I avoid such extra phase of convert .xls → .xlsx and directly read the .xls with xlsread?
On my PC there is only MicroSoft Office 2019 (included Excel). Do I need to install also LibreOffice/OpenOffice?
Thank you for the clarification.

My system

  • OS: Windows 10 Pro
  • Octave version: Version 6.3.0
  • Installation method: e.g. Downloaded and installed “octave-6.3.0-w64-installer.exe” from Download

Did you read xlsread’s help text? - just type
help xlsread
to get some clues.

In short:
If you don’t have MS-Excel installed, you’d need to install some Java-based support software and be sure to have Java support.
Install the required Java based libraries (a collection of one or more .jar files) in your profile directory in a subdir called “Java” - then those libraries will be “loaded” (added to the javclasspath) automatically.
For just .xls (the old binary BIFF8 format) the JXL is probably the easiest, and JXL can also read the even more ancient BIFF5 based .xls format.

1 Like

Hi @PhilipN , I have installed on my PC Microsoft Office 2019, included Excel (I updated the fist post).
According to your reply I assume that I don’t have to install any Java software. But I still get the error and I can’t directly read .xls files.
How to solve the situation?

IIRC, you’d need to load the ‘windows’ package before first using the ‘io’ package for the interface to Excel to work correctly. (Please correct me if that is wrong.)

pkg load windows
pkg load io
1 Like

That is correct! Now it works perfectly. Thank you.

Ah yes that’s true. I’ve set “pkg load windows” ages ago in an .octaverc file and forgot about it.