필터 지우기
필터 지우기

getting excel variable in a loop

조회 수: 2 (최근 30일)
wesso Dadoyan
wesso Dadoyan 2016년 6월 27일
편집: Walter Roberson 2016년 6월 29일
Folder=pwd;
d = dir('bhcf*.xlsx');
N_File=numel(d);
e = actxserver ('Excel.Application');
h=waitbar(0,'Progress...');
for o = 1:N_File
waitbar(o/N_File,h);
ExcelWorkbook = e.workbooks.Open(fullfile(Folder,d(o).name));
there is a column called BHCK5481 in each of these excel files where the sheet is called Sheet1. How can I download it? I tried Sheet=ExcelWorkbook.Sheet1.item('BHCK5481'); but it didn't work Any help is appreciated
  댓글 수: 3
Image Analyst
Image Analyst 2016년 6월 27일
I guess you have a "named range" in each workbook and that range is named BHCK5481. Is that correct? And that range might be in any column, not some fixed column like column #3. Is that correct?
wesso Dadoyan
wesso Dadoyan 2016년 6월 29일
yes it is correct

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by