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.
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.
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.