필터 지우기
필터 지우기

Problem accessing Excel files through xlsread

조회 수: 43 (최근 30일)
Ari Bronstein
Ari Bronstein 2016년 10월 11일
댓글: Allan N 2019년 2월 23일
Hi everyone, I'm trying to open Excel files via MATLAB using xlsread, and this is what I get:
data = xlsread('..\10 Power Curve Test\04 AEP\AEP calculations T94 T107 T149 - Final.xls',16,'C8:F51');
Error using xlsread (line 249)
Error: The server threw an exception.
I've dug down into the code and found the problem line, in OpenExcelWorkbook:
Excel.workbooks.Open(filename, 0, readOnly);
Excel is a COM.Excel_Application object.
When trying to run this line independently of the larger function, I get the following error message:
Error using Interface.000208DB_0000_0000_C000_000000000046/Open
Invoke Error, Dispatch Exception:
Source: Microsoft Excel
Description: Sorry, we couldn't find ..\10 Power Curve Test\04 AEP\AEP calculations T94 T107 T149 - Final.xlsx. Is it possible it
was moved, renamed or deleted?
Help File: xlmain11.chm
Help Context ID: 0
However, I know that the file exists, because I can open it with fopen:
fopen('..\10 Power Curve Test\04 AEP\AEP calculations T94 T107 T149 - Final.xlsx')
ans =
3
I've also tried using xlsread with other files, from within the working directory, and the same problem persists.
Can anyone help me with this? My only idea at this point is to force a Windows update and look for updates to Office and hope that fixes something.
Thanks in advance!

채택된 답변

XM Liu
XM Liu 2016년 11월 17일
1- open the excel> file, >option, >add in, manage then select COM ADD IN, and clear everything (unchecked). everything should be cleared (unchecked). 2- restart the PC, and open the matlab. 3- perform xlsread command.
PS. For those people who use foxit pdf reader, it is potential to face this problem, so follow mentioned order.
  댓글 수: 1
Ari Bronstein
Ari Bronstein 2016년 11월 17일
This is it! I didn't uncheck everything (we have 2 Pi Datalink Add-ins in our office), but I unchecked the FoxitReader PDF Creator Add-in, and it works now!

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

추가 답변 (2개)

Soma Ardhanareeswaran
Soma Ardhanareeswaran 2016년 10월 20일
The error observed might be related to spaces in the file path. Try placing the file in another directory without any spaces and observe for the error.
  댓글 수: 1
Ari Bronstein
Ari Bronstein 2016년 10월 21일
Thank you for the suggestion. I had high hopes, but no luck; same error.

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


Jan
Jan 2016년 10월 21일
편집: Jan 2016년 10월 21일
Try to use an absolute path name instead of the '..' . Using relative paths is okay, but often a cause for confusions, because the current folder might be changed unexpectedly by a callback of a timer or a GUI element.
Look in the comments of http://de.mathworks.com/matlabcentral/fileexchange/10465-xlswrite1: 11 Feb 2015 Kevin Gaukel.
  댓글 수: 2
Ari Bronstein
Ari Bronstein 2016년 10월 21일
Thank you for the suggestion, but I really don't think the path to the file is the problem. As mentioned before, fopen works fine.
data = xlsread('c:\Users\abronstein\Downloads\AEPFinal.xlsx',16,'C8:F51');
Error using xlsread (line 249)
Error: The server threw an exception.
Allan N
Allan N 2019년 2월 23일
Did you find a solution to this problem? I, too, am having error on data = xlsread (filename) command. (I am using Win10 with xlsx file with Office 2016). I had no problem with Win7 and Office 2011, and I'm wondering if Excel 2016 does something differently, or perhaps with Win10. Please let me know if you found a solution.

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

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by