Problem with xlsread: xlsread keeps hanging when executed

조회 수: 8 (최근 30일)
Rien
Rien 2016년 4월 6일
댓글: Damian Slawik 2020년 12월 22일
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
Damian Slawik
Damian Slawik 2020년 12월 22일
It happen even with small files

댓글을 달려면 로그인하십시오.

추가 답변 (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