Problem with xlsread: xlsread keeps hanging when executed
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Rien
am 6 Apr. 2016
Kommentiert: Damian Slawik
am 22 Dez. 2020
Hi all,
I have a very weird problem with the xlsread function. I have made an application that is compiled in an executable. This executable reads in data from multiple excel files when it is run. Also, the executable run is started from an excel add-in. The executable is run already for quite some time without too much problems and is regularly recompiled. But since a few days, it appears that from time to time xlsread keeps "hanging" when reading in data. It looks as if the code execution is just halted. Furthermore, we found out that:
- The problem is not reproducable: with every run, the problem is happening in another part of the code (but every time when reading in excel data).
- There is no error message.
- Some pc's experience the problem, others not.
- It can't be a network issue, because reading is done directly from the hard drive of the pc (C drive).
I have no clue about what could be the problem, especially I never had any problem reading in data in the past with the same code. Has anyone an idea what the problem could be (f.e. is there an excel update done by microsoft in the past weeks that could affect the excel read in in matlab?)?
Thanks for sharing your ideas!
1 Kommentar
Alireza Fatemi
am 10 Okt. 2016
Did you find a solution for this? I am having the same issue: at some random point of executing xlsread, MATLAB becomes unresponsive. When that happens, the computer has to be restarted or else MATLAB (even after restarting MATLAB and executing the same codes) keeps hanging at the first xlsread command. The size of the file that is to be imported is 9 KB. I was hoping you could share the solution.
Akzeptierte Antwort
Ryan Santos
am 11 Apr. 2016
Hello Rien,
I'm not entirely sure what the problem is, but I have a few ideas of things that might be related.
Make sure that you have the appropriate read/write permissions on the Excel files (and the parent folder) you are trying to use. 'xlsread' will usually hang if it does not have the appropriate permissions to read or write a file.
Also make sure that the files you are trying to view are not being opened twice, there could be some issue with trying to view a file when its already opened.
Its possible that this could be a memory issue as well. You can try viewing the memory usage of your program while its running and before it hangs. Its possible that something has changed on your machine and it can no longer handle the memory requirements for your application. Perhaps the Excel files has grown too big and is taking up too much room in memory.
Additionally, I think this is very unlikely a problem caused by an Excel update. Though one possible solution might be to reinstall both Excel and Matlab and see if that changes anything.
Hopefully one of these ideas can point you in the right direction to resolving your issue.
Thanks,
Ryan Santos
3 Kommentare
Damian Slawik
am 22 Dez. 2020
I have the same problem.
It disaper when file is written in old xls format
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!