0
for j=1:???
Loc = [func(j) '1:' func(j) '803'];

Result = get(Excel.Activesheet, 'Range', Loc);

Result.Select;

expResult = Excel.Selection.Value

func converts number to character of excel column. I want to read all data. If I write a number for ??? e.g 100 only Read 100 columns.

image

David Rushton
  • 4,915
  • 1
  • 17
  • 31
hileli
  • 21
  • 2
  • Are you trying to read an xls file or do you actually have to get the active sheet from Excel? – Swier May 13 '16 at 11:51
  • if I give a value for j, I can read sheets or files but I want to read all columns and only filled columns. Some sheets have 30 some sheets have 150 columns – hileli May 13 '16 at 11:57
  • Have you tried the `xlsread` function? It's documentation can be found here: http://mathworks.com/help/matlab/ref/xlsread.html – Swier May 13 '16 at 14:42

0 Answers0