Read-Only in Excel
1 回表示 (過去 30 日間)
古いコメントを表示
When I execute the code below it prints out in Excel ok but it is in "Read-Only". How do I stop "Read-Only"?
exl = actxserver('excel.application');
exlWkbk = exl.Workbooks;
exlFile = exlWkbk.Open(['C:/MATLAB7/work/file.xls']);
exlSheet1 = exlFile.Sheets.Item('Sheet1');
mm=2
for t = 0:500:10000
mm=mm+1
vx1=6*t-800
vy1=3*t-300
vz1=2*t-100
vr1=(vx1^2+vy1^2+vz1^2)^.5
exlSheet1.Range(['B' num2str(mm)]).value = vx1;
exlSheet1.Range(['C' num2str(mm)]).value = vy1;
exlSheet1.Range(['D' num2str(mm)]).value = vz1;
exlSheet1.Range(['E' num2str(mm)]).value = vr1;
end
exl.visible = true;
exlWkbk.Close;
exl.Quit;
0 件のコメント
回答 (1 件)
Titus Edelhofer
2013 年 9 月 18 日
Hi, I'm not sure what your question is. But in any case you will need to call
exlWkbk.Save
before you close it, since you modified it before. Second, if you get an error of "Read only", the natural question is: is your file read only (i.e., write protected)?
Titus
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Import from MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!