Write to existing excel file
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Image Analyst
le 9 Sep 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 commentaires
Voir également
Catégories
En savoir plus sur Spreadsheets dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!