MATLAB Answers


Error with xlswrite (error 0x800A03EC)

Asked by alex
on 19 Sep 2019
Latest activity Edited by Adam Danz
on 23 Sep 2019
Hello everyone!
Unfortunatelly, i have a problem while using xlswrite.
i read other tasks from people who had the same error,however it's not the same situation.
I mean that when i write this
it works fine!
However when i write this i get this error
Error using xlswrite (line 219)
Excel returned: Error: Object returned error code:
the difference between the two commands is the file. The first file is a common xls file. The second file is an xls file that has locked the sheets. However the cell O17 is unlocked!
Anyway, i unlock the sheets and it continues to give me the same error.
Any idea what to do?
I use matalab R2014a


on 19 Sep 2019
I realised that i can write in at the first sheet only, but not in any other sheet.
If i put any other sheet as first i can write at it.
any ideas?
on 19 Sep 2019
In the excel file the first sheet is a normal sheet with data.
the second third and fourth sheet are charts
and the rest of the sheets are normal sheets with data.
Somewhere in my code i use Activex server
e = actxserver('Excel.Application');
ewb = e.Workbooks.Open(excelfile);
the Item(2).Name is not the 2nd sheet because it is a chart ,but it is the 5th sheet.
But,when i tried to
the xlswrite function obviously considers the second sheet(which is a chart i remind) as number 2 sheet. and it tried to xlswrite there and as a result i got the error i mentioned.
Anyway,thanks for the help again!

Sign in to comment.




2 Answers

Answer by CAM
on 19 Sep 2019

Try xlsprotect from File Exchange.
It has worked well for me in the past.


Sign in to comment.

Answer by Adam Danz
on 19 Sep 2019
Edited by Adam Danz
on 23 Sep 2019

This is an excel error code - not a problem with matlab.
If you search for that error code you may find some help. For example,
This error code has also appeared in the forum before and many of those questions have been answered which may give you leads.


Sign in to comment.