Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 422
Default Problem - Shapes.Textboxes

I was trying to help a user out -- but was unable to
His code (with my help, to date) is (in a standard module):

(lines 3,4,5 are in 1 row of the code) - the below is wrapped

Sub Text_Copy()
Worksheets("Summary").Shapes("Text Box 3").TextFrame.Characters.Text =
Worksheets("Description").Shapes("Text Box 1").TextFrame.Characters.Text
& " " & Worksheets("Description").Shapes("Text Box
2").TextFrame.Characters.Text
End Sub


I had it working for "a while", but suddenly it quit working.
What is suspicious about the above?

Tks in Advance

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


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default Problem - Shapes.Textboxes

Greg;
Thanks so much for your input into this situation. My workbook or sheet is
not protected in any way. I just ended up accepting your code (replacing
mine) and everything is great. Thanks for your help. Much appreciated.
Jim May

"Greg Wilson" wrote:

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


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
When drawing shapes in excel the shapes keep disappearing Tape Excel Discussion (Misc queries) 1 October 6th 06 04:23 PM
Text wrap problem when printing labels/textboxes chipshot Excel Discussion (Misc queries) 1 September 30th 05 10:21 PM
tab between several textboxes Kim Excel Worksheet Functions 0 May 9th 05 04:08 PM
How can i get more 3D shapes for Auto shapes in excel? Ajey Excel Discussion (Misc queries) 0 March 3rd 05 09:53 AM
How can i get more 3D shapes for Auto shapes in excel? Ajey Excel Discussion (Misc queries) 0 March 3rd 05 09:53 AM


All times are GMT +1. The time now is 09:14 AM.

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

About Us

"It's about Microsoft Excel"