Filter löschen
Filter löschen

getting excel variable in a loop

2 Ansichten (letzte 30 Tage)
wesso Dadoyan
wesso Dadoyan am 27 Jun. 2016
Bearbeitet: Walter Roberson am 29 Jun. 2016
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 Kommentare
Image Analyst
Image Analyst am 27 Jun. 2016
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 am 29 Jun. 2016
yes it is correct

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by