cl1=get(sht.Cells,'item',RANGE(2),RANGE(1));
cl2=get(sht.Cells,'item',RANGE(4),RANGE(3));
rng=get(sht,'range',cl1,cl2);
B=get(rng,'value')
However, if I have interactively selected a range in Excel. How can I
retrieve the bounds of that range and/or load the data into Matlab?
Bert
Sent via Deja.com
http://www.deja.com/
Referencing the Selection property of the Excel Application object will
return the currently active range:
CurrentRange = ExcelApplication.Selection
(Actually, the Selection property returns whatever is selected in the Excel
application. Usually, though, you would call this after selecting some
cells, in which case it returns the Range object associated with the cells.)
Jordan
"Bert Jagers" <hraj...@my-deja.com> wrote in message
news:91o1q6$1h9$1...@nnrp1.deja.com...
> CurrentRange = ExcelApplication.Selection
Thank you, Jordan. I had already expected that you would be the one
answering.
> Actually, the Selection property returns whatever is selected in
> the Excel application.
Hm, hadn't thought of that yet. Seems that I will have to do a bit more
to verify what has been selected.
Thanks again,
I have a somewhat related question to this topic. I am trying to use a COM server to interact with Excel, as such I need to actively select cells myself.
rngs is a cell object containing the cellstrings to be selected, with a semi colon (;) at the end. When making the string of cells to be selected as follows:
cells = [rngs{:}];
cells = cells(1:end-1);
I retreive a string like:
cells = 'A1;A2;A3;....;C3'
basically containing all the cells i need...
When i enter this into the Excel com object like:
Excel.ActiveSheet.Range(cells).Select (or whatever other thing i need to do with these cells)
I get an error. Need to say that the list of cells to be selected is very long and this procedure works when only a few cells need to be selected.
Does anybody know the limitations on the number of cells to be selected at once?
Thanks