Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to rectify errors while using 'xlswrite' function?

조회 수: 1 (최근 30일)
MatlabUser
MatlabUser 2016년 9월 3일
마감: MATLAB Answer Bot 2021년 8월 20일
Hello everyone,
I am using 'xlswrite' function for writing data to an excel-sheet. My code is something like this -
values = {1, 2, 3 ; 4, 5, 'x' ; 7, 8, 9};
headers = {'First', 'Second', 'Third'};
xlswrite('myExample.xls', [headers; values]);
I am getting following error message:
"Error using xlswrite (line 220)
Invoke Error, Dispatch Exception:
Source: Microsoft Office Excel
Description: 'C:\Users\Admin\Documents\MATLAB\myExample.xls' could not be
found. Check the spelling of the file name, and verify that the file
location is correct.
If you are trying to open the file from your list of most recently used
files, make sure that the file has not been renamed, moved, or deleted.
Help File: C:\Program Files\Microsoft Office\Office12\1033\XLMAIN11.CHM
Help Context ID: 0"
Now, kindly suggest how to rectify above mentioned error. Thanks!
  댓글 수: 2
Walter Roberson
Walter Roberson 2016년 9월 3일
Make sure that C:\Users\Admin\Documents\MATLAB\myExample.xls does not already exist as a link to somewhere else, and make sure that you have write access to C:\Users\Admin\Documents\MATLAB\
MatlabUser
MatlabUser 2016년 9월 7일
편집: MatlabUser 2016년 9월 7일
Thanks for reply! I followed as per your suggestions but still facing the same problem. I guess its something related to invoking the Excel application in activex mode. However I am unable to figure out the exact cause of the problem. Also I would like to mention here that the same code is working perfectly on other PC without any issue at all..

답변 (1개)

Sindhuja Parimalarangan
Sindhuja Parimalarangan 2016년 9월 6일
This error is generated directly by Excel upon opening the file from MATLAB. You can find more information about this issue on Microsoft's website:
  댓글 수: 1
MatlabUser
MatlabUser 2016년 9월 7일
Thanks for reply! I have gone through the link provided. I checked the relevant registry settings in my PC. All settings seems alright but I am not able to resolve the issue. Any other option which I need to try, please let me know.

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by