Matlab 实现对 Excel sheet 重命名 合并单元格
作者:互联网
- matlab对excel中的sheet重命名
1 e = actxserver('Excel.Application'); % open Activex server 2 ewb = e.Workbooks.Open(excelPath); % open file (enter full path!) 3 4 ewb.Worksheets.Item(1).Name = 'I am sheet1'; % rename sheet 1 5 ewb.Worksheets.Item(2).Name = 'I am sheet2'; 6 7 ewb.Worksheets.Item(1).Range('A1:J1').MergeCells=1; % 合并EXCEL中shett1里面A1到J1的单元格 8 ewb.Worksheets.Item(2).Range('A1:J1').MergeCells=1; 9 10 ewb.Save % save to the same file 11 ewb.Close(false) 12 e.Quit
标签:sheet,ewb,单元格,Excel,J1,A1,Item,Worksheets 来源: https://www.cnblogs.com/dhui-w/p/15912424.html