【发布时间】:2013-09-23 12:14:15
【问题描述】:
我想直接从 MATLAB 中删除 excel 文件中的所有数字。我可以使用 activex 选择所有数字,但我无法找到删除它们的方法。
我的代码:
filename_out = 'Libraries\Documents\TEST.xlsx'; % filename
Excel = actxserver('Excel.Application'); % open the connection
set(Excel,'Visible',1);
Excel.Workbooks.Open(filename_out); % open excel file
worksheets = Excel.sheets;
numSheets = worksheets.Count; % count the number of sheets
for s = 1 : numSheets % do a loop for all sheets
worksheets.Item(s).Shapes.SelectAll; % select the figure
% How to delete selection? *
end
感谢您的帮助!
【问题讨论】: