Deleting pictures from Excel: Shapes.Item.Delete doesn't work

조회 수: 1 (최근 30일)
AR
AR 2018년 8월 1일
편집: Walter Roberson 2018년 8월 13일
I have an Excel sheet (assume sheet 5) with several images in it. That is to say .jpg or .png. I do this:
... blah blah...
sheethandle = get(Sheets, 'Item', 5);
invoke(sheethandle, 'Activate');
Activesheet = Excel.Activesheet;
Shapes = sheethandle.Shapes;
for s = Shapes.Count:-1:1
Shapes.Item(s).Delete;
end
At this point, the Shapes variable shows a count of 0 when examined in the workspace. However, the Excel sheet still shows all the images intact. What do I need to do to make it work?

답변 (1개)

Othmane ELMOUATAMID
Othmane ELMOUATAMID 2018년 8월 13일
편집: Othmane ELMOUATAMID 2018년 8월 13일
Hi AR,
Check this answer.
  댓글 수: 1
AR
AR 2018년 8월 13일
I have seen this answer before. As far as I can tell, this is exactly what I am doing (reported above), but isn't exactly working. Thanks.

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

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by