Manipulate Excel From Matlab

Hi
How can i merge two or more excel cells from matlab? I think is something with actxserver function.
Thanks George

 채택된 답변

George
George 2011년 10월 7일

1 개 추천

% 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;

댓글 수: 1

AwedBy Matlab
AwedBy Matlab 2012년 11월 14일
Can these activex commands be used on an existing XLS file? And can I create a spreadsheet with merged cells and save it as an excel file from matlab, but without the edits being done in real-time in Excel, like in the above code? Thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

질문:

2011년 10월 7일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by