How to store my array into Excel

5 views (last 30 days)
Abdullah Azzam
Abdullah Azzam on 22 Oct 2017
Commented: dpb on 22 Oct 2017
I have created a dummy array in order to see how the function xlswrite work bu the following error appear:
>> y= zeros [5,1]
>> xlswrite('filename.xlsx',y)
Error using xlswrite (line 220)
Invoke Error, Dispatch Exception:
Source: Microsoft Excel
Description: Microsoft Excel cannot access the file 'C:\Program Files\MATLAB\R2013a\bin\64F1E720'. There are several possible reasons:
The file name or path does not exist.
The file is being used by another program.
The workbook you are trying to save has the same name as a currently open workbook.
Help File: xlmain11.chm
Help Context ID: 0
Thanks for the help in advance
  3 Comments
Abdullah Azzam
Abdullah Azzam on 22 Oct 2017
I haven't tried to restart my computer, but shouldn't the xlswrite create my excel file "filename.xlsx" rather than looking for existing one?
dpb
dpb on 22 Oct 2017
As Rik says, there are others besides "failing to create"; one of the other two are more likely.
I've also found that if there's ever an error in the OLE expression that the internal cleanup routine may fail and in that case I've found nothing other than restarting Matlab will recover the state. In that case, however, the error is one of an internal failure so doesn't appear to be the issue here...

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!