Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Accessing Non-Excel Libre Spreadsheet from MATLAB

Subject: Accessing Non-Excel Libre Spreadsheet from MATLAB

From: Eric Diaz

Date: 21 Mar, 2012 05:34:31

Message: 1 of 10

I recently started using LibreOffice for my Office document needs, as it is completely free and nearly 100% compatible with MS Office documents.

However, the other day I was using a MATLAB program that required access to an Excel spreadsheet. I encountered an error during this process and I am not sure why.

I didn't copy the error down, but I remember it saying something about an Excel server. Well, I don't have Excel because I don't have MS Office. So, is that why MATLAB had trouble with accessing the contents of the spreadsheet? I don't really understand this COM server stuff at all? Is there a COM server method for accessing open-source office spreadsheets?

Subject: Accessing Non-Excel Libre Spreadsheet from MATLAB

From: Eric Diaz

Date: 25 Mar, 2012 20:48:10

Message: 2 of 10

Bump...

Subject: Accessing Non-Excel Libre Spreadsheet from MATLAB

From: Steven_Lord

Date: 26 Mar, 2012 13:43:11

Message: 3 of 10



"Eric Diaz" <eric.diaz@gmail.com> wrote in message
news:jkbp97$bmn$1@newscl01ah.mathworks.com...
> I recently started using LibreOffice for my Office document needs, as it
> is completely free and nearly 100% compatible with MS Office documents.
>
> However, the other day I was using a MATLAB program that required access
> to an Excel spreadsheet. I encountered an error during this process and I
> am not sure why.
>
> I didn't copy the error down, but I remember it saying something about an
> Excel server. Well, I don't have Excel because I don't have MS Office.
> So, is that why MATLAB had trouble with accessing the contents of the
> spreadsheet?

When running XLSREAD on a machine that is not a Windows machine with
Microsoft Excel installed, XLSREAD will operate in "basic mode":

http://www.mathworks.com/help/techdoc/ref/xlsread.html

"[num,txt,raw] = xlsread(filename,sheet,range,'basic') reads data from the
spreadsheet in basic mode, the default on systems without Excel for
Windows."

Basic mode has some limitations, as described in the Input Arguments section
of that documentation, and it appears you were trying to do something that
exceeded the capabilities of basic mode.

> I don't really understand this COM server stuff at all? Is there a COM
> server method for accessing open-source office spreadsheets?

If the program offers a COM interface, yes, but a quick glance at the
LibreOffice website didn't indicate that it had such an interface.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Accessing Non-Excel Libre Spreadsheet from MATLAB

From: Eric Diaz

Date: 27 Mar, 2012 22:53:14

Message: 4 of 10

> When running XLSREAD on a machine that is not a Windows machine with
> Microsoft Excel installed, XLSREAD will operate in "basic mode":
>
> http://www.mathworks.com/help/techdoc/ref/xlsread.html
>
> "[num,txt,raw] = xlsread(filename,sheet,range,'basic') reads data from the
> spreadsheet in basic mode, the default on systems without Excel for
> Windows."
>
> Basic mode has some limitations, as described in the Input Arguments section
> of that documentation, and it appears you were trying to do something that
> exceeded the capabilities of basic mode.
>

Right...I remember it saying something about "basic mode" too, but it still gave the errors.

> > I don't really understand this COM server stuff at all? Is there a COM
> > server method for accessing open-source office spreadsheets?
>
> If the program offers a COM interface, yes, but a quick glance at the
> LibreOffice website didn't indicate that it had such an interface.

OK, thanks. I guess that is about as close to an answer as I can get, since you work at TMW. Do you know whether there is any way to resolve this problem other than bowing down to the almighty Microsoft Office? I would definitely like to see support for an open office suite, like Libre.

Subject: Accessing Non-Excel Libre Spreadsheet from MATLAB

From: Steven_Lord

Date: 28 Mar, 2012 14:10:03

Message: 5 of 10



"Eric Diaz" <eric.diaz@gmail.com> wrote in message
news:jktgcq$m80$1@newscl01ah.mathworks.com...
>> When running XLSREAD on a machine that is not a Windows machine with
>> Microsoft Excel installed, XLSREAD will operate in "basic mode":
>>
>> http://www.mathworks.com/help/techdoc/ref/xlsread.html
>>
>> "[num,txt,raw] = xlsread(filename,sheet,range,'basic') reads data from
>> the spreadsheet in basic mode, the default on systems without Excel for
>> Windows."
>>
>> Basic mode has some limitations, as described in the Input Arguments
>> section of that documentation, and it appears you were trying to do
>> something that exceeded the capabilities of basic mode.
>>
>
> Right...I remember it saying something about "basic mode" too, but it
> still gave the errors.

If you show the group a small section of your code and explain specifically
what you're trying to do, perhaps someone will have some suggestions for how
to do what you want in such a way that you don't run into the basic mode
limitations.

>> > I don't really understand this COM server stuff at all? Is there a COM
>> > server method for accessing open-source office spreadsheets?
>>
>> If the program offers a COM interface, yes, but a quick glance at the
>> LibreOffice website didn't indicate that it had such an interface.
>
> OK, thanks. I guess that is about as close to an answer as I can get,
> since you work at TMW. Do you know whether there is any way to resolve
> this problem other than bowing down to the almighty Microsoft Office? I
> would definitely like to see support for an open office suite, like Libre.

Having a function to read in LibreOffice spreadsheets sounds like a
reasonable enhancement request to make to Technical Support. Let them know
the type of functionality you'd like to see included in such a function, so
they can capture it in the enhancement database and give the developers
guidance when or if they decide to implement this feature. [Enhancement
requests like this tend to carry more weight from users.]

Another approach you could take would be to ask the LibreOffice developers
for an enhancement, a COM interface to their software on Windows. If they
implemented such an interface, you could use the COM interface functionality
in MATLAB to interact with LibreOffice in the same way that the COM
interface functionality allows users to interact with the COM interface
provided by Microsoft Excel.

http://www.mathworks.com/help/techdoc/matlab_external/brd4at8.html

http://www.mathworks.com/help/techdoc/matlab_external/bqdwu3j.html#bqd_o32

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Accessing Non-Excel Libre Spreadsheet from MATLAB

From: TideMan

Date: 27 Mar, 2012 23:52:37

Message: 6 of 10

On Wednesday, March 28, 2012 11:53:14 AM UTC+13, Eric Diaz wrote:
> > When running XLSREAD on a machine that is not a Windows machine with
> > Microsoft Excel installed, XLSREAD will operate in "basic mode":
> >
> > http://www.mathworks.com/help/techdoc/ref/xlsread.html
> >
> > "[num,txt,raw] = xlsread(filename,sheet,range,'basic') reads data from the
> > spreadsheet in basic mode, the default on systems without Excel for
> > Windows."
> >
> > Basic mode has some limitations, as described in the Input Arguments section
> > of that documentation, and it appears you were trying to do something that
> > exceeded the capabilities of basic mode.
> >
>
> Right...I remember it saying something about "basic mode" too, but it still gave the errors.
>
> > > I don't really understand this COM server stuff at all? Is there a COM
> > > server method for accessing open-source office spreadsheets?
> >
> > If the program offers a COM interface, yes, but a quick glance at the
> > LibreOffice website didn't indicate that it had such an interface.
>
> OK, thanks. I guess that is about as close to an answer as I can get, since you work at TMW. Do you know whether there is any way to resolve this problem other than bowing down to the almighty Microsoft Office? I would definitely like to see support for an open office suite, like Libre.

A work around would be to save the spreadsheet as a .csv file, then getting the data into Matlab is a breeze (and faster than xlsread as well).

Subject: Accessing Non-Excel Libre Spreadsheet from MATLAB

From: mklcst mklcst

Date: 4 Jun, 2012 08:46:06

Message: 7 of 10

TideMan <mulgor@gmail.com> wrote in message <14349772.98.1332892357752.JavaMail.geo-discussion-forums@ynaz5>...
> On Wednesday, March 28, 2012 11:53:14 AM UTC+13, Eric Diaz wrote:
> > > When running XLSREAD on a machine that is not a Windows machine with
> > > Microsoft Excel installed, XLSREAD will operate in "basic mode":
> > >
> > > http://www.mathworks.com/help/techdoc/ref/xlsread.html
> > >
> > > "[num,txt,raw] = xlsread(filename,sheet,range,'basic') reads data from the
> > > spreadsheet in basic mode, the default on systems without Excel for
> > > Windows."
> > >
> > > Basic mode has some limitations, as described in the Input Arguments section
> > > of that documentation, and it appears you were trying to do something that
> > > exceeded the capabilities of basic mode.
> > >
> >
> > Right...I remember it saying something about "basic mode" too, but it still gave the errors.
> >
> > > > I don't really understand this COM server stuff at all? Is there a COM
> > > > server method for accessing open-source office spreadsheets?
> > >
> > > If the program offers a COM interface, yes, but a quick glance at the
> > > LibreOffice website didn't indicate that it had such an interface.
> >
> > OK, thanks. I guess that is about as close to an answer as I can get, since you work at TMW. Do you know whether there is any way to resolve this problem other than bowing down to the almighty Microsoft Office? I would definitely like to see support for an open office suite, like Libre.
>
> A work around would be to save the spreadsheet as a .csv file, then getting the data into Matlab is a breeze (and faster than xlsread as well).

I think it's time for Matlab to fully support libreoffice (or OpenOffice or whatelse).
A part for the office license, it would amazing also for the unix platform linux and Mac.

Subject: Accessing Non-Excel Libre Spreadsheet from MATLAB

From: Steven_Lord

Date: 4 Jun, 2012 13:37:39

Message: 8 of 10



"mklcst mklcst" <mkcst@gmail.com> wrote in message
news:jqhske$lpg$1@newscl01ah.mathworks.com...
> TideMan <mulgor@gmail.com> wrote in message
> <14349772.98.1332892357752.JavaMail.geo-discussion-forums@ynaz5>...
>> On Wednesday, March 28, 2012 11:53:14 AM UTC+13, Eric Diaz wrote:
>> > > When running XLSREAD on a machine that is not a Windows machine with
>> > > Microsoft Excel installed, XLSREAD will operate in "basic mode":
>> > >
>> > > http://www.mathworks.com/help/techdoc/ref/xlsread.html
>> > >
>> > > "[num,txt,raw] = xlsread(filename,sheet,range,'basic') reads data
>> > > from the spreadsheet in basic mode, the default on systems without
>> > > Excel for Windows."
>> > >
>> > > Basic mode has some limitations, as described in the Input Arguments
>> > > section of that documentation, and it appears you were trying to do
>> > > something that exceeded the capabilities of basic mode.
>> > >
>> >
>> > Right...I remember it saying something about "basic mode" too, but it
>> > still gave the errors.
>> >
>> > > > I don't really understand this COM server stuff at all? Is there a
>> > > > COM server method for accessing open-source office spreadsheets?
>> > >
>> > > If the program offers a COM interface, yes, but a quick glance at the
>> > > LibreOffice website didn't indicate that it had such an interface.
>> >
>> > OK, thanks. I guess that is about as close to an answer as I can get,
>> > since you work at TMW. Do you know whether there is any way to resolve
>> > this problem other than bowing down to the almighty Microsoft Office? I
>> > would definitely like to see support for an open office suite, like
>> > Libre.
>>
>> A work around would be to save the spreadsheet as a .csv file, then
>> getting the data into Matlab is a breeze (and faster than xlsread as
>> well).
>
> I think it's time for Matlab to fully support libreoffice (or OpenOffice
> or whatelse). A part for the office license, it would amazing also for the
> unix platform linux and Mac.

Then please contact Technical Support and ask them to enter this request
into the enhancement database (or update the existing entry with one more
"vote".)

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Accessing Non-Excel Libre Spreadsheet from MATLAB

From: D

Date: 23 Oct, 2013 23:28:09

Message: 9 of 10

TideMan <mulgor@gmail.com>
> A work around would be to save the spreadsheet as a .csv file, then getting the data into Matlab is a breeze (and faster than xlsread as well).

I ran into OP's problem too, and I found that csvread, which you seem to be suggesting as a work around, only reads in csv files whose data is numbers(double); no other data types are accepted. Having a text heading cell such as 'values' will throw an error and the script will stop.
I'm another vote for MATLAB being able to read/write Libre files. I will find and contribute to existing requests at MATLAB and at Libre.

Subject: Accessing Non-Excel Libre Spreadsheet from MATLAB

From: TideMan

Date: 23 Oct, 2013 23:56:52

Message: 10 of 10

On Thursday, October 24, 2013 12:28:09 PM UTC+13, D wrote:
> TideMan <mulgor@gmail.com>
>
> > A work around would be to save the spreadsheet as a .csv file, then getting the data into Matlab is a breeze (and faster than xlsread as well).
>
>
>
> I ran into OP's problem too, and I found that csvread, which you seem to be suggesting as a work around, only reads in csv files whose data is numbers(double); no other data types are accepted. Having a text heading cell such as 'values' will throw an error and the script will stop.
>
> I'm another vote for MATLAB being able to read/write Libre files. I will find and contribute to existing requests at MATLAB and at Libre.

Why on earth would you want to use csvread for such a purpose?
The help clearly says:
" The file can only contain
    numeric values."
Use textscan.
It is so much more flexible.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us