actxserver excel application

13 ビュー (過去 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 Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by