matlab excel, import data excel is fail

i import my data into matlab but fail. Matlab noticed that: "coul not open the spreadsheet. matlab reported the following error: Unreadable excel file: no public fielddisplay alert exists for class COM.excel_application

댓글 수: 4

Geoff Hayes
Geoff Hayes 2014년 6월 3일
It would be helpful to include the code that you were using to open the Excel file. That may point to why the import failed. If I try [NUM,TXT,RAW]=xlsread('data.xlsx');, then the data is read in successfully.
Titus Edelhofer
Titus Edelhofer 2014년 6월 3일
Just to be sure: when you double click on the file, you can open it in Excel?
dpb
dpb 2014년 6월 3일
Is the file from the Excel version installed on the machine in question? Wondering about version issues.
sara
sara 2015년 1월 28일
Try to "run MATLAB as administrator". This might solve the problem. Probably MATLAB does not have access to the files...

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

답변 (2개)

Image Analyst
Image Analyst 2014년 6월 3일

0 개 추천

You probably have some code like this from my demo that I have posted many times:
% If your user has your Excel file already open,
% this code saves & closes the file, then closes excel:
Excel = actxGetRunningServer('Excel.Application');
Excel.DisplayAlerts = false; % Avoid excel warning popups
Excel.WorkBooks.Item('Filename.xls').Save;
Excel.WorkBooks.Item('Filename.xls').Close;
Excel.Quit;
I think the DisplayAlerts property was only introduced recently (Office 2007 or 2010 - I don't remember). You may have a version of Excel prior to when that property was introduced. Just delete that line from your code.

댓글 수: 3

TRAN
TRAN 2014년 6월 4일
Thank for your help. Because i have just studied matlab to apply in finance. So i can understand your help clearly. Could you teach me the step to repair that error. May i contact with you by email (my email is tamtt1988@gmail.com) Thank you so much.
Image Analyst
Image Analyst 2014년 6월 4일
  1. Type ctrl-f.
  2. Paste in "Excel.DisplayAlerts" and
  3. click Find Next.
  4. Place the cursor to the left margin until the arrow points to the right.
  5. Click to highlight the entire line.
  6. Type the delete key to delete that line..
  7. Type F5 to run your code and test it.
sara
sara 2015년 1월 28일
Try to "run MATLAB as administrator". This might solve the problem. Probably MATLAB does not have access to the files...

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

sara
sara 2015년 1월 28일

0 개 추천

Try to "run MATLAB as administrator". This might solve the problem. Probably MATLAB does not have access to the files...

질문:

2014년 6월 3일

답변:

2015년 1월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by