How to delete figure in an excel file
Mostrar comentarios más antiguos
Hi,
I would like to directly delete all the figures in an excel file from MATLAB. I can select all the figures using activex but I cant' figure out a way to delete them.
My code:
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
Thanks for any help!
Respuesta aceptada
Más respuestas (2)
Image Analyst
el 16 de Sept. de 2013
0 votos
Go to the sheet. Start recording a macro. Then do your operations (deleting things, etc.). Then stop recording and look at the macro source code and see what code Excel put in there. Then transfer that code to your MATLAB program.
1 comentario
Image Analyst
el 17 de Sept. de 2013
So, did that work for you?
Christe Antoine
el 17 de Sept. de 2013
0 votos
Categorías
Más información sobre Use COM Objects in MATLAB en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!