Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How separate text boxes from pictures in the same worksheet by code?

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pictures and Text Boxes print in wrong position and size in 2007 Uttersmd Excel Discussion (Misc queries) 0 October 21st 09 06:57 PM
pictures in comment boxes? Excel_ing for Greatness Excel Discussion (Misc queries) 2 June 13th 07 11:24 PM
Looking for code to separate one line of text into multiple lines in Excel [email protected] Excel Worksheet Functions 1 February 13th 07 12:59 AM
Code-Copy & Paste in Text Boxes Bourbon[_27_] Excel Programming 1 January 28th 04 12:53 AM
Select text boxes code Nicky[_2_] Excel Programming 2 January 27th 04 10:57 PM


All times are GMT +1. The time now is 04:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"