Excel "Open method of Workbooks class failed"
조회 수: 67 (최근 30일)
이전 댓글 표시
Hello,
I am working with 3 functions running in parallel with parfor, and they are supposed to give approximately 3000 output files each. The code doesn't change much between each iteration, they are basically 3 big loops.
However, they stop running after around 250 iterations and I have this error message on one of them:
Error using xlsread (line 257)
Invoke Error, Dispatch Exception:
Source: Microsoft Excel
Description: Open method of Workbooks class failed
Help File: xlmain11.chm
Help Context ID: 0
Error in read_excel2cell (line 2)
[dummy1, dummy2, result] = xlsread(filename);
I tried restarting Matlab, restarting my pc, overwriting the .xlsx files in case they were corrupted etc... But I can't get it work while the exact same code was working fine this morning.
Does anybody have a lead on what could cause this kind of issue ? I exhausted every solution I could find about it.
Have a nice day
댓글 수: 0
답변 (1개)
Bhargavi Maganuru
2020년 7월 8일
Hi,
This can occur if the directory you are trying to write to does not exist, or if you don't have write access to that directory. While you can "write" to files which don't previously exist (MATLAB will create them), the directory does need to exist beforehand.
This can also happen in some situations where the user which starts the Excel is a system user. Excel expects the existence of the Desktop directory. To enable the command to work try the following:
For x64 processes create the following folder:
C:\Windows\SysWOW64\config\systemprofile\Desktop
For x86 processes create the following folder:
C:\Windows\System32\config\systemprofile\Desktop
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!