I have a code that I could insert a shape using such a line `ThisWorkbook.ActiveSheet.Shapes.AddShape` then loads a picture to the shape.
Is there a way to unload the image loaded into the shape without deleting it. All what I found is a way to delete the shape
Code: Select all
Public Sub UnloadPicture(ByVal sShapeName As String)
Dim myShape As Shape
On Error Resume Next
Set myShape = ThisWorkbook.ActiveSheet.Shapes(sShapeName)
If Not Err Then myShape.Delete
Set myShape = Nothing
End Sub
Sub Test_UnloadPicture()
UnloadPicture "MyImage"
End Sub