View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gunnar Johansson Gunnar Johansson is offline
external usenet poster
 
Posts: 47
Default How separate text boxes from pictures in the same worksheet by code?

Here is the solution

Sub LockTextBoxNotPic()
Dim myShape As Shape
For Each myShape In ActiveSheet.Shapes
If myShape.Type = msoTextBox Then
myShape.Locked = True
Else
If myShape.Type = msoPicture Then
myShape.Locked = False
End If
End If
Next myShape
End Sub


/Regards


"Marie J-son" skrev i meddelandet
...
Hi everyone,
I have PICTURES (created by "CopyPicture method" by the way) embedded in a
excel worksheet and I want to allow to copy them. I ALSO in the same sheet
have TEXT BOXES and I want to protect their text. I tried with
drawingobjects.select, but found out that a picture is a drawing object.

Is there a specified objecttype just for text boxes I can use to protect
just them? [Sheet1.TextBoxes.Protect = True would be nice..but doesn't
exist.]

I DON'T want to change from text boxes to merged cells , I have just left
that track of several reasons. I want my boxes protected (and protected
cells in the sheet) and allow copy the pictures

/BEST REGARDS
and thanks in advance