Error using ==> xlswrite, Could you explain?

조회 수: 13 (최근 30일)
Kanghyun
Kanghyun 2014년 4월 24일
댓글: Image Analyst 2019년 1월 25일
Hello.
I got a following error message that I cannot explain.
??? Error using ==> xlswrite at 213 Invoke Error, Dispatch Exception: Source: Microsoft Excel Description: SaveAs method of Workbook class failed Help File: xlmain11.chm Help Context ID: 0
I was accessing m files from (say) computer A through the network(sharing folders) and was running the matlab on computer B and trying to save the result on computer A.. When I runned the program on computer A itself, there was no problem. On computer B, I am using matlabR2008b and Microsoft Excel 2010. Could anyone explain this? Thanks.

답변 (2개)

Image Analyst
Image Analyst 2014년 4월 24일
Are you sure that sharing permissions are set up to allow computer B to write files to computer A? For example, can you transfer a file from B to the same folder on A using Windows Explorer? If you open Excel on B can you save a workbook to that same folder on A directly from Excel (so that MATLAB is not even involved at all)?

Sam Oliver
Sam Oliver 2017년 6월 29일
편집: Sam Oliver 2017년 6월 30일
I was running into the same issue and fixed it with the following solution. The automatic process that launches MATLAB from computer B calls Excel when using xlswrite. It uses a Windows system user account to launch the process and Excel is looking for the 'Desktop' directory within this system account.
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
  댓글 수: 2
Mohammad
Mohammad 2019년 1월 24일
편집: Mohammad 2019년 1월 24일
In my case, the path that I was writing the excel file was too long.
Image Analyst
Image Analyst 2019년 1월 25일
In Windows, Excel filenames are only allowed to be up to 218 characters long.

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

카테고리

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