Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I enable the spellchecker in a protected worksheet? | Excel Programming | |||
supressing a message in vba | Excel Programming | |||
How to invoke spellchecker in VBA to check a string? | Excel Programming | |||
ActiveXTextBox with SpellChecker ? | Excel Programming | |||
Using Excel Spellchecker On a Locked sheet | Excel Programming |