Discover MakerZone

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

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

I'm having an issue with xlswrite

Asked by Nick Trenton on 20 Jul 2012

Hey everyone,

I've been lurking the boards the last few weeks hoping to find an answer to this problem but no avail. Here's my issue: when I use xlswrite, xlswrite isn't saving Excel files to my computer like it should. Instead of saving, for instance, when I use xlswrite('hi.xlsx',1234) to write the integer 1234 to 'hi.xlsx', Matlab will literally open up a new, unsaved Excel file with the following text:

1234 hi.xlsx hi.xlsx hi.xlsx hi.xlsx hi.xlsx hi.xlsx hi.xlsx

No matter how many iterations or changes I make to xlswrite, it always shows up something like that, where it will repeat the name of the file beneath the matrix I pass to xlswrite, and never saves anything. It's really frustrating when I'm trying to write a few hundred Excel files and have to go in by hand to do it.

Let me know if anyone has seen this before or has any solutions. xlswrite worked fine before, and sometimes it still does work fine, but more often it glitches like this.

Thanks.

3 Comments

Ryan on 20 Jul 2012

Which version of Matlab are you using? Perhaps there is a known bug.

Nick Trenton on 20 Jul 2012

7.8.037 (R2009a), but I've tried it on 2011a as well and it gives me a similar error, not only on my computer but another lab member's computer.

Nick Trenton on 20 Jul 2012

I may have found the error...I was searching my computer for "xlswrite" and realized there was another version of xlswrite that a colleague was using on my external harddrive (which I set to Matlab's path)...it must have been using this version whenever I had my external harddrive connected.

Sorry for the confusion, the problem is fixed!

Nick Trenton

Products

No products are associated with this question.

1 Answer

Answer by Walter Roberson on 24 Jul 2012

Nick wrote 20 Jul 2012,

I may have found the error...I was searching my computer for "xlswrite" and realized there was another version of xlswrite that a colleague was using on my external harddrive (which I set to Matlab's path)...it must have been using this version whenever I had my external harddrive connected.
Sorry for the confusion, the problem is fixed!

1 Comment

Jan Simon on 24 Jul 2012

Please, Nick, accept this answer, although it is your own.

Walter Roberson

Contact us