MATLAB Answers


error using xlsread command in matlab

Asked by Homa
on 27 Nov 2012

I have written in my matlab program:

EnergyfromSun = xlsread('C:\Homa\Thesis\Matlab\SC\ASTMG173num.xls'); but I got this message:

??? No appropriate method, property, or field UsedRange for class Interface.Microsoft_Excel_14.0_Object_Library._Chart.

Error in ==> xlsread at 302 DataRange = Excel.ActiveSheet.UsedRange;

Error in ==> T2011 at 10 EnergyfromSun = xlsread('C:\Homa\Thesis\Matlab\SC\ASTMG173num.xls');

>> This excel sheet has 2 columns and 2002 rows and I am using matlab 7.11.0 version Please help me, I am too confused. Thanks Homa


Jan Simon
on 27 Nov 2012

@Lalit: I do not assume, that the filename is wrong. Using the backslash is valid under Windows.

Is there a chart in the .xls file? Is there anything other than plain data?

on 27 Nov 2012

@ Walter yes there is a chart!! Thanks a lot



No products are associated with this question.

1 Answer

Answer by Walter Roberson
on 27 Nov 2012
 Accepted answer

The error message is complaining that UsedRange does not apply to charts. I do not know enough about Excel to know what the solution is, other than to delete the chart. Possibly if you specify the range of rows/columns that might solve the problem.


Join the 15-year community celebration.

Play games and win prizes!

Learn more
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

MATLAB Academy

New to MATLAB?

Learn MATLAB today!