Windows versions diff

  • Thread starter Thread starter Garry Jones
  • Start date Start date
G

Garry Jones

On UserForm_Initialize() I read in a value to a text box.

This following code then highlights the text in that text box.

With TextBox1
..SelStart = 0
..SelLength = Len(.Text)
..SetFocus
End With

But this only works on Windows 98, but not on Windows 2000.

Is there any other code that is universal and will give me the same
effect in both operating systems?

Garry Jones
 
What happens (does not happen) on your Win 2000 system?

This works for me with Windows 2000, Excel XP:

'****
Private Sub UserForm_Initialize()
TextBox1.Text = "Blaha blaha"
With TextBox1
..SelStart = 0
..SelLength = Len(.Text)
..SetFocus
End With
End Sub
'****

Regards
Anders Silvén
 
Anders said:
What happens (does not happen) on your Win 2000 system?

The text was not highlighted with my code. On a friends windows 2000,
Excel 2000.

I took the exact same file home on a diskette to windows 98, excel 97
and the text was highlighted.

Can it matter that I am reading in the text as control source?

Maybe my friend is missing a setting for colour of highlighted text?

Garry Jones
 
Hi Garry

Try pressing a character key. If it works right then the old text will be replaced by your
entry, colored or not. I've had no problems with code like that on any Windows platform
either.
 
Back
Top