actxserver excel application
22 次查看(过去 30 天)
显示 更早的评论
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...
0 个评论
采纳的回答
Jan
2011-12-2
A search in the forum is helpful also: http://www.mathworks.com/matlabcentral/answers/?term=xlsread+activex
4 个评论
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;
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!