Clear embedded documents

  • Thread starter Thread starter none
  • Start date Start date
N

none

I have some embedded documents in an excel worksheet. Is there a VBA
command to clear/delete the embedded documents in a range of fields?

I have tried
Selection.ClearContents
and then
Selection.Delete
, with no success (the document may move fields, but is still in
there):


Thanks!
 
Maybe something like:

Option Explicit
Sub testme()

Dim myShape As Shape
Dim wks As Worksheet

Set wks = ActiveSheet

With wks
For Each myShape In .Shapes
If Intersect(myShape.TopLeftCell, .Range("A1:f10")) Is Nothing Then
'skip it
Else
myShape.Delete
End If
Next myShape
End With
End Sub
 
Back
Top