Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 300
Default Spell checking text boxes

I protected a spreadsheet I'm responsible for and got complaints from users
that they could no longer spell check the text boxes from the Drawing menu.
Even though they were unprotected, the fact that the sheet was protected
gave an error message when the spell check was selected from the menu. No
big deal. I simply added a button to the left of each text box that calls a
macro that unprotects and spell checks. No doubt seeing the button will
increase the users checking. But after the macro is run all the text lines
in the text box are selected. I haven't found a way to unselect them. This
is the macro I'm using:

Sub SpellCheckCore(S As String)
' code to spell check text box. must be on sheet with box
' arg: name of text box in string

Application.ScreenUpdating = False

Dim Flag As Boolean
If ActiveSheet.ProtectContents Then
Flag = True
ActiveSheet.Unprotect
End If

ActiveSheet.Shapes(S).Select
Selection.CheckSpelling

If Flag Then ActiveSheet.Protect

End Sub

I'm using Excel 97.

Don <donwiss at panix.com.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 473
Default Spell checking text boxes


Try adding
ActiveWindow.RangeSelection.Select
after
Selection.CheckSpelling

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 300
Default Spell checking text boxes

On Wed, 03 Dec 2003, Bill Manville wrote:

Try adding
ActiveWindow.RangeSelection.Select
after
Selection.CheckSpelling


The problem with this is it takes their focus out of the text box and back
to the sheet, when it is very possible their focus was in the box when they
clicked the button.

Don <donwiss at panix.com.
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 473
Default Spell checking text boxes

Don Wiss wrote:
The problem with this is it takes their focus out of the text box and back
to the sheet, when it is very possible their focus was in the box when they
clicked the button.


OK.
Incidentally I don't see the original problem you reported (of all the text
lines being selected at the end of the macro. Which version of Excel are you
using? Are the buttons from the control toolbox or the forms toolbar?

Does this help:

Sub SpellCheckCore(S As String)
' code to spell check text box. must be on sheet with box
' arg: name of text box in string

Application.ScreenUpdating = False

Dim Flag As Boolean
If ActiveSheet.ProtectContents Then
Flag = True
ActiveSheet.Unprotect
End If

ActiveSheet.TextBoxes(S).CheckSpelling '<<<<<<

If Flag Then ActiveSheet.Protect

End Sub

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 300
Default Spell checking text boxes

On Fri, 05 Dec 2003, Bill Manville wrote:

Don Wiss wrote:
The problem with this is it takes their focus out of the text box and back
to the sheet, when it is very possible their focus was in the box when they
clicked the button.


OK.
Incidentally I don't see the original problem you reported (of all the text
lines being selected at the end of the macro. Which version of Excel are you
using? Are the buttons from the control toolbox or the forms toolbar?


Excel 97. Buttons from Forms toolbar.

Does this help:


ActiveSheet.TextBoxes(S).CheckSpelling '<<<<<<


I'll try it at work today. I know this did not work:

ActiveSheet.Shapes(S).CheckSpelling

Don <donwiss at panix.com.
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
Spell Check in Text Boxes Lee Ann[_2_] Excel Worksheet Functions 18 August 20th 09 09:32 PM
Spell Checking with checking cell notes jfitzpat Excel Discussion (Misc queries) 0 August 8th 07 10:26 PM
Spell checking a protected worksheet Trevor Excel Discussion (Misc queries) 0 February 14th 07 07:25 AM
spell checking options dvs_47 Excel Worksheet Functions 2 March 6th 06 09:16 PM


All times are GMT +1. The time now is 08:43 AM.

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"