Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Pasted text will not spell check

I am trying to spell check the contents of a TextBox on a UserForm.


MikeH was good enough to provide me this code last night which places the
text onto a hidden worksheet and the checks for spelling errors. The problem
is that spell checker will not find spelling error in the text pasted to the
worksheet. as a test (just to make sure the spell checker was running) I
placed a misspelled word in cell F2 and the spell checker did find that
misspelling. I removed the last line of Mike's code so that the text would
be left on the worksheet, just so I could try running the spell checker but
it still would not find the error in the text.




Sheets("Sheet2").Range("a1").Value = TextBox1.Value
Application.EnableEvents = False
Sheets("Sheet2").Range("a1").CheckSpelling
Application.EnableEvents = True
TextBox1.Text = ""
TextBox1.Text = Sheets("Sheet2").Range("a1").Value
Sheets("Sheet2").Range("a1").Value = ""

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Pasted text will not spell check

Hi,

The final code I posted was this after I added a dummy cell to spell check
to ensure the spell checker never went on to check the rest of the worksheet.
I have tested this multiple times and can't find a problem with it. perhaps
you could expalin a bit more about what the issue is.

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim DummyCell As Range
Set DummyCell = Range("IV65536")
Sheets("Sheet1").Range("a1").Value = TextBox1.Text
Application.EnableEvents = False
Union(DummyCell, Sheets("Sheet1").Range("a1")).CheckSpelling
Application.EnableEvents = True
TextBox1.Text = ""
TextBox1.Text = Sheets("Sheet1").Range("a1").Value
Sheets("Sheet1").Range("a1").Value = ""
End Sub

Mike

"Patrick C. Simonds" wrote:

I am trying to spell check the contents of a TextBox on a UserForm.


MikeH was good enough to provide me this code last night which places the
text onto a hidden worksheet and the checks for spelling errors. The problem
is that spell checker will not find spelling error in the text pasted to the
worksheet. as a test (just to make sure the spell checker was running) I
placed a misspelled word in cell F2 and the spell checker did find that
misspelling. I removed the last line of Mike's code so that the text would
be left on the worksheet, just so I could try running the spell checker but
it still would not find the error in the text.




Sheets("Sheet2").Range("a1").Value = TextBox1.Value
Application.EnableEvents = False
Sheets("Sheet2").Range("a1").CheckSpelling
Application.EnableEvents = True
TextBox1.Text = ""
TextBox1.Text = Sheets("Sheet2").Range("a1").Value
Sheets("Sheet2").Range("a1").Value = ""


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Pasted text will not spell check


I get the following error:

Method 'union' of object '_global' failed and the following line was
highlighted

Union(DummyCell, Sheets("Sheet2").Range("a1")).CheckSpelling

So in the interest of time and knowing there would be no other text on the
worksheet I tried to move on with you original
code:

Sheets("Sheet2").Range("a1").Value = TextBox1.Value
Application.EnableEvents = False
Sheets("Sheet2").Range("a1").CheckSpelling
Application.EnableEvents = True
TextBox1.Text = ""
TextBox1.Text = Sheets("Sheet2").Range("a1").Value
Sheets("Sheet2").Range("a1").Value = ""


This worked to a point. It would place the text in cell A1 and run the spell
checker, but it would not hit on the misspelled words in the text it placed
in cell A1. When it did not work, I decided, as a test, to place a
misspelled word in another cell and rerun the code. It would not find the
misspelled words in A1, but would find the misspelled word I placed in the
other cell.

As an additional test I removed the line which cleared the text from cell A1
and after running the code I went to Sheet2 and looked to ensure the text
was there, it was. Then I tried running the spell checker and it still did
not see the errors in the text in cell A1. I tried changing your code to
paste as Text as opposed to Value but that did not help. If I type a
misspelled word in A1 spell checker sees it.

Again thanks for your time and help.





"Mike H" wrote in message
...
Hi,

The final code I posted was this after I added a dummy cell to spell check
to ensure the spell checker never went on to check the rest of the
worksheet.
I have tested this multiple times and can't find a problem with it.
perhaps
you could expalin a bit more about what the issue is.

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim DummyCell As Range
Set DummyCell = Range("IV65536")
Sheets("Sheet1").Range("a1").Value = TextBox1.Text
Application.EnableEvents = False
Union(DummyCell, Sheets("Sheet1").Range("a1")).CheckSpelling
Application.EnableEvents = True
TextBox1.Text = ""
TextBox1.Text = Sheets("Sheet1").Range("a1").Value
Sheets("Sheet1").Range("a1").Value = ""
End Sub

Mike

"Patrick C. Simonds" wrote:

I am trying to spell check the contents of a TextBox on a UserForm.


MikeH was good enough to provide me this code last night which places the
text onto a hidden worksheet and the checks for spelling errors. The
problem
is that spell checker will not find spelling error in the text pasted to
the
worksheet. as a test (just to make sure the spell checker was running) I
placed a misspelled word in cell F2 and the spell checker did find that
misspelling. I removed the last line of Mike's code so that the text
would
be left on the worksheet, just so I could try running the spell checker
but
it still would not find the error in the text.




Sheets("Sheet2").Range("a1").Value = TextBox1.Value
Application.EnableEvents = False
Sheets("Sheet2").Range("a1").CheckSpelling
Application.EnableEvents = True
TextBox1.Text = ""
TextBox1.Text = Sheets("Sheet2").Range("a1").Value
Sheets("Sheet2").Range("a1").Value = ""


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Pasted text will not spell check


Patrick,

What version of Excel are you using?

Mike

"Patrick C. Simonds" wrote:

I get the following error:

Method 'union' of object '_global' failed and the following line was
highlighted

Union(DummyCell, Sheets("Sheet2").Range("a1")).CheckSpelling

So in the interest of time and knowing there would be no other text on the
worksheet I tried to move on with you original
code:

Sheets("Sheet2").Range("a1").Value = TextBox1.Value
Application.EnableEvents = False
Sheets("Sheet2").Range("a1").CheckSpelling
Application.EnableEvents = True
TextBox1.Text = ""
TextBox1.Text = Sheets("Sheet2").Range("a1").Value
Sheets("Sheet2").Range("a1").Value = ""


This worked to a point. It would place the text in cell A1 and run the spell
checker, but it would not hit on the misspelled words in the text it placed
in cell A1. When it did not work, I decided, as a test, to place a
misspelled word in another cell and rerun the code. It would not find the
misspelled words in A1, but would find the misspelled word I placed in the
other cell.

As an additional test I removed the line which cleared the text from cell A1
and after running the code I went to Sheet2 and looked to ensure the text
was there, it was. Then I tried running the spell checker and it still did
not see the errors in the text in cell A1. I tried changing your code to
paste as Text as opposed to Value but that did not help. If I type a
misspelled word in A1 spell checker sees it.

Again thanks for your time and help.





"Mike H" wrote in message
...
Hi,

The final code I posted was this after I added a dummy cell to spell check
to ensure the spell checker never went on to check the rest of the
worksheet.
I have tested this multiple times and can't find a problem with it.
perhaps
you could expalin a bit more about what the issue is.

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim DummyCell As Range
Set DummyCell = Range("IV65536")
Sheets("Sheet1").Range("a1").Value = TextBox1.Text
Application.EnableEvents = False
Union(DummyCell, Sheets("Sheet1").Range("a1")).CheckSpelling
Application.EnableEvents = True
TextBox1.Text = ""
TextBox1.Text = Sheets("Sheet1").Range("a1").Value
Sheets("Sheet1").Range("a1").Value = ""
End Sub

Mike

"Patrick C. Simonds" wrote:

I am trying to spell check the contents of a TextBox on a UserForm.


MikeH was good enough to provide me this code last night which places the
text onto a hidden worksheet and the checks for spelling errors. The
problem
is that spell checker will not find spelling error in the text pasted to
the
worksheet. as a test (just to make sure the spell checker was running) I
placed a misspelled word in cell F2 and the spell checker did find that
misspelling. I removed the last line of Mike's code so that the text
would
be left on the worksheet, just so I could try running the spell checker
but
it still would not find the error in the text.




Sheets("Sheet2").Range("a1").Value = TextBox1.Value
Application.EnableEvents = False
Sheets("Sheet2").Range("a1").CheckSpelling
Application.EnableEvents = True
TextBox1.Text = ""
TextBox1.Text = Sheets("Sheet2").Range("a1").Value
Sheets("Sheet2").Range("a1").Value = ""



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Pasted text will not spell check


2007, but

I recreated my UserForm and now you code works as advertised. Not sure what
the problem was but now that it is working I will move on.

Thanks for your help.



"Mike H" wrote in message
...
Patrick,

What version of Excel are you using?

Mike

"Patrick C. Simonds" wrote:

I get the following error:

Method 'union' of object '_global' failed and the following line was
highlighted

Union(DummyCell, Sheets("Sheet2").Range("a1")).CheckSpelling

So in the interest of time and knowing there would be no other text on
the
worksheet I tried to move on with you original
code:

Sheets("Sheet2").Range("a1").Value = TextBox1.Value
Application.EnableEvents = False
Sheets("Sheet2").Range("a1").CheckSpelling
Application.EnableEvents = True
TextBox1.Text = ""
TextBox1.Text = Sheets("Sheet2").Range("a1").Value
Sheets("Sheet2").Range("a1").Value = ""


This worked to a point. It would place the text in cell A1 and run the
spell
checker, but it would not hit on the misspelled words in the text it
placed
in cell A1. When it did not work, I decided, as a test, to place a
misspelled word in another cell and rerun the code. It would not find the
misspelled words in A1, but would find the misspelled word I placed in
the
other cell.

As an additional test I removed the line which cleared the text from cell
A1
and after running the code I went to Sheet2 and looked to ensure the text
was there, it was. Then I tried running the spell checker and it still
did
not see the errors in the text in cell A1. I tried changing your code to
paste as Text as opposed to Value but that did not help. If I type a
misspelled word in A1 spell checker sees it.

Again thanks for your time and help.





"Mike H" wrote in message
...
Hi,

The final code I posted was this after I added a dummy cell to spell
check
to ensure the spell checker never went on to check the rest of the
worksheet.
I have tested this multiple times and can't find a problem with it.
perhaps
you could expalin a bit more about what the issue is.

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim DummyCell As Range
Set DummyCell = Range("IV65536")
Sheets("Sheet1").Range("a1").Value = TextBox1.Text
Application.EnableEvents = False
Union(DummyCell, Sheets("Sheet1").Range("a1")).CheckSpelling
Application.EnableEvents = True
TextBox1.Text = ""
TextBox1.Text = Sheets("Sheet1").Range("a1").Value
Sheets("Sheet1").Range("a1").Value = ""
End Sub

Mike

"Patrick C. Simonds" wrote:

I am trying to spell check the contents of a TextBox on a UserForm.


MikeH was good enough to provide me this code last night which places
the
text onto a hidden worksheet and the checks for spelling errors. The
problem
is that spell checker will not find spelling error in the text pasted
to
the
worksheet. as a test (just to make sure the spell checker was running)
I
placed a misspelled word in cell F2 and the spell checker did find
that
misspelling. I removed the last line of Mike's code so that the text
would
be left on the worksheet, just so I could try running the spell
checker
but
it still would not find the error in the text.




Sheets("Sheet2").Range("a1").Value = TextBox1.Value
Application.EnableEvents = False
Sheets("Sheet2").Range("a1").CheckSpelling
Application.EnableEvents = True
TextBox1.Text = ""
TextBox1.Text = Sheets("Sheet2").Range("a1").Value
Sheets("Sheet2").Range("a1").Value = ""





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 343
Default Pasted text will not spell check


Discovered one of my problems, and boy don't I feel dumb. The text in the
TextBox must be in all caps. Well under proofing options, I had Ignore words
in uppercase set. So now I have added the following line to ensure I will
not have that problem on any other machines.


Application.SpellingOptions.IgnoreCaps = False



"Patrick C. Simonds" wrote in message
...
2007, but

I recreated my UserForm and now you code works as advertised. Not sure
what the problem was but now that it is working I will move on.

Thanks for your help.



"Mike H" wrote in message
...
Patrick,

What version of Excel are you using?

Mike

"Patrick C. Simonds" wrote:

I get the following error:

Method 'union' of object '_global' failed and the following line was
highlighted

Union(DummyCell, Sheets("Sheet2").Range("a1")).CheckSpelling

So in the interest of time and knowing there would be no other text on
the
worksheet I tried to move on with you original
code:

Sheets("Sheet2").Range("a1").Value = TextBox1.Value
Application.EnableEvents = False
Sheets("Sheet2").Range("a1").CheckSpelling
Application.EnableEvents = True
TextBox1.Text = ""
TextBox1.Text = Sheets("Sheet2").Range("a1").Value
Sheets("Sheet2").Range("a1").Value = ""


This worked to a point. It would place the text in cell A1 and run the
spell
checker, but it would not hit on the misspelled words in the text it
placed
in cell A1. When it did not work, I decided, as a test, to place a
misspelled word in another cell and rerun the code. It would not find
the
misspelled words in A1, but would find the misspelled word I placed in
the
other cell.

As an additional test I removed the line which cleared the text from
cell A1
and after running the code I went to Sheet2 and looked to ensure the
text
was there, it was. Then I tried running the spell checker and it still
did
not see the errors in the text in cell A1. I tried changing your code to
paste as Text as opposed to Value but that did not help. If I type a
misspelled word in A1 spell checker sees it.

Again thanks for your time and help.





"Mike H" wrote in message
...
Hi,

The final code I posted was this after I added a dummy cell to spell
check
to ensure the spell checker never went on to check the rest of the
worksheet.
I have tested this multiple times and can't find a problem with it.
perhaps
you could expalin a bit more about what the issue is.

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Dim DummyCell As Range
Set DummyCell = Range("IV65536")
Sheets("Sheet1").Range("a1").Value = TextBox1.Text
Application.EnableEvents = False
Union(DummyCell, Sheets("Sheet1").Range("a1")).CheckSpelling
Application.EnableEvents = True
TextBox1.Text = ""
TextBox1.Text = Sheets("Sheet1").Range("a1").Value
Sheets("Sheet1").Range("a1").Value = ""
End Sub

Mike

"Patrick C. Simonds" wrote:

I am trying to spell check the contents of a TextBox on a UserForm.


MikeH was good enough to provide me this code last night which places
the
text onto a hidden worksheet and the checks for spelling errors. The
problem
is that spell checker will not find spelling error in the text pasted
to
the
worksheet. as a test (just to make sure the spell checker was
running) I
placed a misspelled word in cell F2 and the spell checker did find
that
misspelling. I removed the last line of Mike's code so that the text
would
be left on the worksheet, just so I could try running the spell
checker
but
it still would not find the error in the text.




Sheets("Sheet2").Range("a1").Value = TextBox1.Value
Application.EnableEvents = False
Sheets("Sheet2").Range("a1").CheckSpelling
Application.EnableEvents = True
TextBox1.Text = ""
TextBox1.Text = Sheets("Sheet2").Range("a1").Value
Sheets("Sheet2").Range("a1").Value = ""



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
Using Spell Check function in text box when worksheet is protected Paul Excel Discussion (Misc queries) 0 February 8th 07 04:29 PM
Spell check Brent Excel Discussion (Misc queries) 1 December 5th 06 10:12 PM
Spell check Tonks Excel Worksheet Functions 2 July 31st 06 11:44 AM
... Can I set Spell Check to automatically check my spelling ... Dr. Darrell Setting up and Configuration of Excel 0 March 21st 06 08:26 PM


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