% MATLAB Automation client example
%
% Open Excel, add workbook, change active worksheet,
% get/put array, save.
% First, open an Excel Server.
e = actxserver('Excel.Application');
% Insert a new workbook.
eWorkbook = e.Workbooks.Add;
e.Visible = 1;
% Make the first sheet active.
eSheets = e.ActiveWorkbook.Sheets;
eSheet1 = eSheets.get('Item', 1);
eSheet1.Activate;
% Merge Cells
eActivesheetRange = e.Activesheet.get('Range', 'A1:B1');
eActivesheetRange.MergeCells = 1;