以下是 VBA 代码,可用于删除 Excel 中所有工作簿中的图片:
Sub DeleteAllImages()
Dim ws As Worksheet
Dim shp As Shape
For Each ws In ThisWorkbook.Worksheets
For Each shp In ws.Shapes
If shp.Type = msoPicture Then
shp.Delete
End If
Next shp
Next ws