Write to existing excel file
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Image Analyst
el 9 de Sept. de 2012
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 comentarios
Ver también
Categorías
Más información sobre Spreadsheets en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!