View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Greg Wilson Greg Wilson is offline
external usenet poster
 
Posts: 747
Default Problem - Shapes.Textboxes

I have it working reliably.
- Do you get an error message?
- If so, what?
- Does the problem still occur if you paste the code to a new wb and change
sheet names and insert text boxes as required?

Assuming the wks is protected, one guess is that Text Box 3 originally had
the "Lock Text" checkbox unchecked and at some point it got checked. Perhaps
through VBA (LockedText = True). So now, when the wks is protected, the
macro will fail whereas it wouldn't have when it was unchecked. You should
get the error message "Unalble to set the Text property of the Characters
class".

Assuming the wks is protected and xl2003 or higher, another guess is that
the "Edit Objects" protection option formerly was checked and now is
unchecked.

Another guess is that sheet names or text box names have been accidently
changed (maybe just a space?).

Suggested code change (although there was nothing wrong with yours IMO):-

Sub Text_Copy()
Dim ch1 As Characters
Dim ch2 As Characters
Dim ch3 As Characters

With Sheets("Description")
Set ch1 = .Shapes("Text Box 1").TextFrame.Characters
Set ch2 = .Shapes("Text Box 2").TextFrame.Characters
End With
With Sheets("Summary")
Set ch3 = .Shapes("Text Box 3").TextFrame.Characters
End With
ch3.Text = ch1.Text & " " & ch2.Text
End Sub

Regards,
Greg