MATLAB Answers


xlsWrite works once then I get error code 0x800AC472

Asked by Don
on 5 Feb 2013

xlsWRITE will work once and then it returns:

   Error: Object returned error code: 0x800AC472

Error using xlswrite (line 220) Error: Object returned error code: 0x800AC472

If I close Matlab and reopen it works one time again...

How can I fix this for use in a script? If I enter the commands in Command window it works OK Here's the script code:

[p,n,e]=fileparts(filename); newFileName = fullfile(filepath, [n,'Ratio']); xlswrite(newFileName,RatioResults);

[Merged from duplicate]

This is the error code. Excel is NOT loaded into memory, i.e., is not open. Only Matlab is running: Command Window, Editor, Figure window.

"Error using xlswrite (line 220)
Error: Object returned error code: 0x800AC472
Error in SpectralRatioST (line 389)

I'm analyzing many data files. Every time, the first 350+ lines of my .m file run just fine. Sometimes the last lines that call XLSWRITE work very well for maybe 6 or 8 files, then I get this error message. I have to re-run my program up to 5 times (or more!) before XLSWRITE works properly. Today is a "bad" day -- the error happens frequently

Can anyone explain what is going on here, and, more importantly, how I can fix he problem?

Thanks very much



No products are associated with this question.

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!