I have the same problem right now but I can't fix it with your code.
My working code (without the delete function):
Excel = actxserver ('Excel.Application');
ExcelWorkbook = Excel.workbooks.Add;
Sheets = Excel.ActiveWorkBook.Sheets;
SheetNo = get(Sheets, 'Item', sheet);
print (figure1,'-dbitmap'); xls.Range('I85').PasteSpecial;
I run this code 4 times. So I have 4 figures on my active Excel sheet. But when I run this code again I don't want to add new figures to the already existing - I want to delete the figures that are in this actual sheet and then add the new ones.
Can you help me? Which code do I need ? I tried following but it didn't work for me:
ActiveSheets = Excel.Activesheet;
myshapes = ActiveSheets.Shapes;
for j = myshapes.Count:-1:1
Thank you !