I'have done some experiment and I found a strange behaviur.
In the above code I was attaching an istance of Excel running on pc but ..if i change strategy and ask to matlab to open and load a excel file using the component actxserver('Excel.Application') I'm able to acces to dynamic range:
% Create an Excel object.
e = actxserver('Excel.Application');
e.Visible = 1;
eWkbk = e.Workbooks;
eFile = eWkbk.Open('C:\Users\msalese\Documents\new_finance\Stocks\HistoricalData.xlsm');
eSheet1 = eFile.Sheets.Item('ESTX50');
eSheet1.Activate;
dat_range = 'C7#'; %<<<<<--- DYNAMIC RANGE NOTATION
rngObj = eSheet1.Range(dat_range);
dataTable = rngObj.Value
and this work giving the follwing output:
dataTable =
4316×1 cell array
{[ 0]}
{[ -1.00]}
{[ -2.00]}
{[ -3.00]}
{[ -4.00]}
{[ -5.00]}
{[ -6.00]}
{[ -7.00]}
tahta i can convert in arrau in this way:
table2array(cell2table(dataTable))
I still don't understand why this happen, con someone help me ?
Thanks