Clear embedded documents

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!
 
D

Dave Peterson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top