image thumbnail

Function for faster data transfer Matlab <--> Excel

version (7.24 KB) by Antonio
This modified version makes the original xlsread.m faster and also allows add-ins to be loaded.


Updated 28 Mar 2012

View License

The idea came from a modified version of the xlswrite.m (the xlswrite1.m) posted by Matt Swartz in this fle exchange area on March 21, 2006. This version of xlsread.m was easily accomplished by removing all instances of server open/close functions within the original file, as it was done with xlswrite1.m. Should one use xlswrite1.m in conjunction with the xlsread.m, the data transfer process still takes too long, in addition to yielding undesirable results due to the persistent server open/close.

In order to use it, one must place the following code within the program, as given by Matt Swartz. It opens/closes the activex server, load an add-in if any (by default when Excel opens as a COM server it does NOT load add-ins), and checks to see if the file already exists:

Excel = actxserver ('Excel.Application');
if ~exist(File,'file')
ExcelWorkbook = Excel.Workbooks.Add;

Use xlsread1.m as needed. Then run the following code to close the activex server:

clear Excel

The result was that processing speed of xlsread.m increased dramatically.

Cite As

Antonio (2021). Function for faster data transfer Matlab <--> Excel (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2008a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!