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

20 vues (au cours des 30 derniers jours)
vinvino
vinvino le 11 Juil 2018
Commenté : vinvino le 25 Juil 2018
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!!

Réponse acceptée

OCDER
OCDER le 11 Juil 2018
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 commentaire
vinvino
vinvino le 25 Juil 2018
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');

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Import from MATLAB dans Help Center et File Exchange

Produits


Version

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by