actxserver excel application

조회 수: 11 (최근 30일)
Richard
Richard 2011년 12월 2일
편집: Walter Roberson 2022년 5월 23일
Can anyone give me a simple explanation of how to use actxserver to import data from matlab. I have a working code by using loops and xlsread but the running time is way too long. All I understand about actxserver is that it will save time as it doesn't open and close excel every time it goes through the loop.
I've got this far:
hExcel = actxserver('Excel.Application');
hExcel.visible = 1; % If you want Excel visible.
hExcel.DisplayAlerts = false; % Avoid excel warning popups
Which basically just opens excel. I now need to get some data...

채택된 답변

Jan
Jan 2011년 12월 2일
  댓글 수: 4
Fangjun Jiang
Fangjun Jiang 2011년 12월 2일
Yes, to loop through different files, it's better to provide the full path of the files.
To read all the data in the sheet without specifying the range, use
MyRange=Sheet.UsedRange;
MyData=MyRange.Value;
Richard
Richard 2011년 12월 2일
great.

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

추가 답변 (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