Error using xlswrite (line 226)

Hi All,
I'm trying to use xlswrite but I received this message:
"Error using xlswrite (line 226) Invoke Error, Dispatch Exception: Source: Microsoft Excel Description: Microsoft Excel cannot access the file 'C:\Program FilesC:\Program Files\MATLAB\R2017a\bin\9DDE4000"
What is very strange is that instead xlsread work for the same file. I have no idea of reason. My Office release is 2019 and is activated.
Thank you in advance. Any suggests is very appreciated.
Emanuele

4 件のコメント

Walter Roberson
Walter Roberson 2019 年 10 月 27 日
If that does not work, go into Office and disable any add-ons you might have, especially Foxit
Emanuele
Emanuele 2019 年 10 月 27 日
Thanks Walter for your suggest.
I deactivated the only .com component (WinZip) that was active.
I have try but don't work.
dpb
dpb 2019 年 10 月 27 日
'C:\Program FilesC:\Program Files\MATLAB\R2017a\bin\9DDE4000"
looks funky -- the "C:\Program Files" is duplicated. I'd first suspect your code building the file name has a problem.
Secondly, use Task Manager and make sure there are no zombie copies of Excel still hanging around that didn't close successfully after an earlier failed attempt. I've had that happen innumerable times while messing around w/ COM and having made a typo that caused an internal failure--the cleanup code apparently can't always fix up everything.
Alternatively, closing and restarting MATLAB will get rid of any such instances as well, but until the filename issue is resolved I think you'll continue to have issues...at least that's what the crystal ball is reading.
Emanuele
Emanuele 2019 年 10 月 27 日
Thanks All
I solved.
For dpb, yes you are right but it's only an error in copy error message.
The problem was that xlswrite don't find the right directory of file.
so I specify in this way
filename = 'C:\Users\Pc\Documents\MATLAB\TEST.xlsx';
and all work fine.
What made me go crazy is that instead xlsread work without specify directory. I don't know the reason of this different behavior but now work.
Thanks again.
Emanuele

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeFiles and Folders についてさらに検索

製品

リリース

R2017a

質問済み:

2019 年 10 月 27 日

コメント済み:

2019 年 10 月 27 日

Community Treasure Hunt

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

Start Hunting!

Translated by