MATLAB Answers

Why this Error: Object returned error code: 0x800A01A8 is appear?

18 ビュー (過去 30 日間)
vinvino
vinvino 2018 年 7 月 11 日
コメント済み: vinvino 2018 年 7 月 25 日
Hi all,
While working on the actxserver i am doing some changes in excel for example :
K>> cellrange = ws.Range('C1');
K>> cellrange.Value = 'IamHere';
K>> wb.Save;
Inserted a column and write sting in a cell and saved it, That's perfect.. Then i opened Excel sheet to verify the changes were updated correctly or not. It was update fine. I closed the excel sheet and continued to perform other changes, but i am getting mentioned Error.
K>> ws.Column.Range('D').Insert;
Error: Object returned error code: 0x800A01A8
Why this error is occurring? If we open Excel sheet and again if we want to do change, again do we need to start from step1 (activating the server)?
What is the best way verify the excel sheet at the development stage of the script.
Thanks in Advance!!

採用された回答

OCDER
OCDER 2018 年 7 月 11 日
My guess is this is caused by the loss of write access to your file. To prevent both Excel and Matlab from trying to edit the same file at the same time, one program would have to give up write access. Seems like Matlab loses write access when the file is opened with Excel.
If this is true, then the fix would be to not open the file with Excel midway of a Matlab process.
  1 件のコメント
vinvino
vinvino 2018 年 7 月 25 日
yes you are right.. So whenever we reopen or work with the same file we need to terminate the excel application process from the windows as well using below command i able to do it.
system('taskkill /F /IM EXCEL.EXE');

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

その他の回答 (0 件)

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by