xlswrite and excel 2010

1 回表示 (過去 30 日間)
M M
M M 2011 年 5 月 20 日
For some reason the function xlswrite does not return me an excel spread sheet but a cvs. I am wondering if it is because I am using excel 2010 since even this simple command:
for i = 1:10
A=i;
xlswrite('foo.xls',A,'Sheet1',['A' num2str(i)]);
end
which should give me an excel.xls file with a column from 1 to 10 in areas A from 1 to 10. What I get is a foo.cvs file with the number 10 in cell A1 and this warning
Warning: Could not start Excel server for export.
XLSWRITE will attempt to write file in CSV format.
> In xlswrite at 166
In Untitled2 at 21
A .cvs file would be fine but i need to be able to manipulate where the data is placed in the spreadsheet from the MATLAB code, which it doesn't allow me to do at all even for simpler commands. If someone could let me know why this is happening and if there is anything I can do to fix it, I would really appreciate it. Thanks in advance,
  1 件のコメント
Oleg Komarov
Oleg Komarov 2011 年 5 月 24 日
I have no problem with your script.
Matlab R2011a Vista32 MS Office 2010

サインインしてコメントする。

回答 (2 件)

Razvan
Razvan 2011 年 5 月 22 日
Try
A=[1:10]';
xlswrite('foo.xls',A,'Sheet1');

Walter Roberson
Walter Roberson 2011 年 5 月 24 日
Either you are not using Windows or your Excel is not installed correctly (or perhaps your MATLAB is not installed correctly.)

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by