Code covered by the BSD License  

Highlights from
XLSAPPEND

5.0

5.0 | 3 ratings Rate this file 39 Downloads (last 30 days) File Size: 6.36 KB File ID: #28600

XLSAPPEND

by Brett Shoelson

 

31 Aug 2010 (Updated 07 Sep 2010)

Append data to the next-available row of an existing Excel file with a single call to ActiveX.

| Watch this File

File Information
Description

SYNTAX: [success,message] = xlsappend(file,data,sheet)

XLSAPPEND Stores numeric array or cell array to the end of specified Excel sheet.

REQUIRES ONLY ONE CALL TO THE EXCEL ACTXSERVER, so the overhead is less than for successive xlsread/xlswrite calls.

[SUCCESS,MESSAGE]=XLSAPPEND(FILE,ARRAY,SHEET) writes ARRAY to the Excel workbook, FILE, into the area beginning at COLUMN A and FIRST UNUSED ROW, in the worksheet specified in SHEET. FILE and ARRAY must be specified. If either FILE or ARRAY is empty, an error is thrown and XLSAPPEND terminates. The first worksheet of the workbook is the default. If SHEET does not exist, a new sheet is added at the end of the worksheet collection. If SHEET is an index larger than the number of worksheets, new sheets are appended until the number of worksheets in the workbook equals SHEET. The success of the operation is returned in SUCCESS and any accompanying message, in MESSAGE. On error, MESSAGE shall be a struct, containing the error message and message ID.

MATLAB release MATLAB 7.10 (R2010a)
Other requirements Windows (or other ActiveX-enabled) platform.
Tags for This File  
Everyone's Tags
excel append sheet activex(4)
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
16 Jul 2013 Brett Shoelson

Javier,
The first time you call the function, make sure that you have specified the filename properly, including the exact extension. ("XLS," "XLSX," ...). If appendToXLS doesn't find the Excel file, it will create a CSV-formatted one and operate on it. If that doesn't address your question, please feel free to contact me directly. Perhaps I could figure out specifics if I had your file to work with.
Cheers,
Brett

12 Jul 2013 Javier

Hi,
thanks for sharing! I have a warning the second time I call the function:
Warning: Could not start Excel server for export.
XLSWRITE will attempt to write file in CSV format.
Do I have a problem with ActiveX. How could I solve it? Thanks a lot

14 May 2013 Zoltan

Thanks.

14 Aug 2012 Rossella Blatt Vital

Very nice! Thanks!

Updates
07 Sep 2010

9/7/2010 Update to fix some intro verbiage.

Contact us