If writing or reading repeatedly to same spreadsheets very slow to keep creating and deleting the active x server. These extra 4 lines of code cause xlswrite to remember if you accessed this spreadsheet before and then not re-create the active x server.
Worked for me (I'm obliged to be using R2014b) because it makes multiple writes to the same workbook practical. Far too slow and usually the original hung if there were a lot of writes to be done.
Can't believe it is 6 years since I made this submission!! I'm surprised it is underperforming the normal matlab version but of course they may have improved their version. Against that on 11 July 2016 it seemed to help Pratik. All it does is prevent Matlab creating a new activeXserver every time you write so helpful if you have lots of small writes when you don't want to keep creating new servers. Don't actually know why it would run out of storage faster for Rajesh. Maybe there is some house cleaning happens with all the deletes and recreates as envisaged originally by matlab. Generally lack of deletes has not been a problem and of course faster to not make a new server each time. It must be a different profile of data from Rajesh that does not suit the continuous re-use of the same server. Sorry I can't be more helpful. ps. I still get emails thanking me for this small piece of code. I tell people releasing a piece of open source code involves zero ongoing effort in return for endless gratitude. The opposite of marriage.
I used this function to dump large amounts of data into multiple sheets in an excel file. The function did increase the speed (~15% for the overall code), but it eventually seems to be crashing due to lack of storage, while the Matlab's version seems to be chugging well past that crash point. Any ideas?
The code drastically reduces the time of xlswrite function. Works wonderfully. Thank you so much . Great work
Hi, I'm using 2015b.
I downloaded and unzipped the file, placed the 'improved' xlswrite in my current folder together with the m-file I'm working with, disabled the built-in function by removing E:\matlab\toolbox\matlab\iofun from the Matlab path.
>>which xlswrite -all
and only saw the 'improved' version shown.
I then ran the codes but from the tic toc timer the reading is about 50-ish secs, almost similar to the built-in xlswrite function, also about 50-ish secs.
Did I use the function incorrectly?
How can I use this function in GUI?
As I have downloaded this file and kept it in my current foldeer. After that I ran the code, but the speed did'nt got improved.
Kindly help me out.
I have a model implemented in a spreadsheet and I want to check the results for different combinations of the input parameters. So I made a loop and at each step I use Matlab to write in the excel file the and afterwards to read the value of a specific cell (output of the model). Since I need to do it n thousands of time I was looking for a solution alternative to xlswrite. I tried to modification posted here but I don't see any difference in the performance. I run MATLAB R2014a on a Windows Server 2008 R2 and Excel 2010.
I downloaded the zip file, but when I tried to run the code I get an error of not enough input arguments. How do I properly incorporate this improved xlswrite for my use?
how can i download this file please?
THANK-YOU x 10! - this code works much faster than the original version (on Win7 - 32b - with 2013a)
With just 4 lines of code my script has become 4 times faster!
Oh my god, I can't thank you enough!! I am using MATLAB to locate particles in over 9,000 images and then write location data to excel. This has sped things up incredibly!
Do I need to rename this to xlswrite1.m to distinguish it from the builtin xlswrite?
I optimized my program before I found this and only got 3 write commands left, but this new xlswrite function is roughly 10 times faster.
Works very good, priori to using this it was impossible to run parfor creating a lot of xls files.
Does this leave anything open in the background that would be of concern if writing a large number of spreadsheets - sort of like leaving file pointers open?
Thank you very much for your effort in going into details of ActiveX server when dealing with xls file using MATLAB.
I have to admit that I have no clue what is going when my xlswrite is running as I know superficially that ActiveX server has to be created and I simply use it. I realise your powerful correction of the xlswrite when I struggle to run 7-8 lines of xlswrite continuosly for 360 times and it kept crashing. I have been trying to run it for 2-3 days and it ends up the same way sooner or later. I have to divide it and run seperately but still a painful delay causes freezing several times.
I totally appreciate on what you have done on this and your contribution is highly regarded as a life and time-saver. I can have my program running and getting results thanks to you.
Thank you very much again and please keep it up.