Write to existing excel file
2 ビュー (過去 30 日間)
古いコメントを表示
I want to write a variable (vardata which is 101x120 matrix) to a preexisting excel file (Group 1). I've tried ActiveX but this doesn't seem to do what I want. Ultimately, I want each subject through my loop to have her vardata variable appended to the preexisting excel file. I think I am making this harder than it needs to be but I cannot get vardata to be written to the excel file without it overwriting the previous subject's data. Any help would be appreciated.
Eric
0 件のコメント
回答 (1 件)
Image Analyst
2012 年 9 月 9 日
Define "append". xlswrite will add cells to an existing workbook. If the cells are written to a location where there are no existing cells, then the existing cells will remain intact. If you write to cells in a range that overlaps existing cells, the cells in the overlap region will get replaced and the non-overlapping ones will remain.
If you want to find out the cell range that is used by your workbook, you need to use ActiveX and ask for Excel.worksheets.Item(sheetIndex).UsedRange or Excel.ActiveSheet.UsedRange.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!