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

조회 수: 20 (최근 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개)

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

제품


릴리스

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by