From: arul on
Hi all

I m getting this error
---------------------------------------------------------
??? Invoke Error, Dispatch Exception: Invalid index.
Error in ==> compare_xls at 13
exlSheet1 = exlFile.Sheets.Item('Sheet');
----------------------------------------------------------
while evaluating the COM automation server

exl = actxserver('excel.application');

exlWkbk = exl.Workbooks;

exlFile = exlWkbk.Open(['C:\read.xls']);

exlSheet1 = exlFile.Sheets.Item('Sheet');

robj = exlSheet1.Columns.End(2); % Find the end of the column

numrows = robj.row; % And determine what row it is

dat_range = ['A1:G' num2str(numrows)]; % Read to the last row

rngObj = exlSheet1.Range(dat_range);

exlData = rngObj.Value;

Can anyone help please

Regards
Arul
arul.dsp(a)gmail.com
From: us on
arul <arul.dsp(a)gmail.com> wrote in message <5dd260a0-1a80-467d-9792-6d8c5ca744a4(a)p12g2000prn.googlegroups.com>...
> Hi all
>
> I m getting this error
> ---------------------------------------------------------
> ??? Invoke Error, Dispatch Exception: Invalid index.
> Error in ==> compare_xls at 13
> exlSheet1 = exlFile.Sheets.Item('Sheet');
> ----------------------------------------------------------
> while evaluating the COM automation server

a hint:
- look at this recent thread on proper syntax...

http://www.mathworks.com/matlabcentral/newsreader/view_thread/285795#758671

us