Problem with xlsread: xlsread keeps hanging when executed

10 次查看(过去 30 天)
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 个评论
Alireza Fatemi
Alireza Fatemi 2016-10-10
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.

请先登录,再进行评论。

采纳的回答

Ryan Santos
Ryan Santos 2016-4-11
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 个评论
Damian Slawik
Damian Slawik 2020-12-22
I have the same problem.
It disaper when file is written in old xls format

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by