Write to existing excel file
조회 수: 1 (최근 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!