First of all thanks a lot, for very good answers that I have found here in other topics in the past.
Now to a new challenge:
I am currently working with the COM Add-In in Matlab, i.e. I am reading a Excel Workbook and extracting the Color Property:
excelapp = actxserver('Excel.Application'); %connect to excel
workbook = excelapp.Workbooks.Open('Solutions.xls');
worksheet = workbook.Sheets.Item(1);
ColorValue_Solutions=worksheet.Range('N2').Interior.Color;
Now, I want to do this for cells in the Range A1 up to J222, for which I would like to dynmaically loop through the Range property, letting the programm read each cell individually and then taking out the color proerty. For example:
Columns = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'};
for j = 1:length(Columns)
for i = 1:222
worksheet.(char( strcat('Range(''',Columns(j), num2str(i), ''')') )).Interior.Color
end
end
This, however, results in an error:
Undefined function or variable 'Range('A1')'.
I guess the problem is in the combination of interpreting a string with an included string, i.e. Range('A1').
Any help is much appreciated.