Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Supressing SpellChecker dialogbox


I need the right syntax to* prevent* the Spell Check dialog from showin
when it otherwise would upon encountering a wrong word. In suc
instance, I will rather prefer (to meet a special need ) to have a
Msgbox displayed simply indicating there is a "problem". I tried th
following code and failed, with the Speller dialog popping up each tim
... in spite of negating DisplayAlerts.

Sub SuppressSpeller()

Application.DisplayAlerts=False
x= Cells.CheckSpelling
If x =True then Msgbox "Spell error"
Application.DisplayAlerts=False

End Sub

TIA

Davi

--
david
-----------------------------------------------------------------------
davidm's Profile: http://www.excelforum.com/member.php...fo&userid=2064
View this thread: http://www.excelforum.com/showthread.php?threadid=47882

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Supressing SpellChecker dialogbox

There are several forms of the CheckSpelling method. The Application form
does not display the dialog but has to be given the actual text you want
checked, rather than the range you want checked:

?application.CheckSpelling("the cat has a hat")
True
?application.CheckSpelling("the cat has a kat")
False

So you'd have to write code to pull the range's text into a variable, maybe
a cell at a time, and then use that variable with CheckSpelling.

Sub Example()
Dim Cell As Range
For Each Cell In Range("A1:A10").SpecialCells( _
xlCellTypeConstants, xlTextValues)
If Application.CheckSpelling(Cell.Value) = False Then
MsgBox "Error in cell " & Cell.Address
End If
Next
End Sub


--
Jim
"davidm" wrote in
message ...
|
| I need the right syntax to* prevent* the Spell Check dialog from showing
| when it otherwise would upon encountering a wrong word. In such
| instance, I will rather prefer (to meet a special need ) to have a
| Msgbox displayed simply indicating there is a "problem". I tried the
| following code and failed, with the Speller dialog popping up each time
| .. in spite of negating DisplayAlerts.
|
| Sub SuppressSpeller()
|
| Application.DisplayAlerts=False
| x= Cells.CheckSpelling
| If x =True then Msgbox "Spell error"
| Application.DisplayAlerts=False
|
| End Sub
|
| TIA
|
| David
|
|
| --
| davidm
| ------------------------------------------------------------------------
| davidm's Profile:
http://www.excelforum.com/member.php...o&userid=20645
| View this thread: http://www.excelforum.com/showthread...hreadid=478828
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Supressing SpellChecker dialogbox


Thanks Jim, you've made my day.

David


--
davidm
------------------------------------------------------------------------
davidm's Profile: http://www.excelforum.com/member.php...o&userid=20645
View this thread: http://www.excelforum.com/showthread...hreadid=478828

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
How do I enable the spellchecker in a protected worksheet? Anne CFS Excel Programming 6 July 12th 07 11:12 PM
supressing a message in vba Rob Hargreaves[_2_] Excel Programming 2 June 11th 05 11:11 AM
How to invoke spellchecker in VBA to check a string? KR Excel Programming 1 September 15th 04 09:59 PM
ActiveXTextBox with SpellChecker ? Stuart[_5_] Excel Programming 0 July 23rd 04 08:38 PM
Using Excel Spellchecker On a Locked sheet Doug Lansing Excel Programming 1 September 27th 03 03:06 AM


All times are GMT +1. The time now is 04:26 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"