alternative to TextBox1.Activate

J

jose luis

Hi Forum

Could you give a hand with the following:

1. Worksheet with several TextBoxes from Controls Toolbar

2. In order to jump between the TextBoxes used



Code:
--------------------
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Application.ScreenUpdating = False
Select Case KeyCode
Case vbKeyTab, vbKeyReturn, vbKeyDown, vbKeyUp ''' These are the only keys we care about.
bBackwards = CBool(Shift And 1) Or (KeyCode = vbKeyUp) ''' Determine if we need to move backwards.
If Application.Version < 9 Then Sheet1.Range("A1").Select ''' In Excel 97 we must select a cell before activating another control.
If bBackwards Then TextBox3.Activate
Else TextBox2.Activate ''' Activate the appropriate control based on key(s) pressed.
Application.ScreenUpdating = True
End Select
End Sub
--------------------


3. Worsheet runs well protected but when Shared generates a error
"Activate method of OLEObject failed"

4. Debugging the code, found the activate from the TextBox is where the
error occurs.
5 Turn on the "Trust Access to Visual basic Project" but the bug
remains.

6. Is there a way to "jump" to the next TextBox using a method allowed
in a shared environment?

All ideas welcome and appreciated.

Thanks

Jose Luis
 
J

jose luis

Trying to found a solution I research that changing the textboxes to
simple cells I can use
Application.Goto Reference:=Sheets(1).Range("NameCell")

Nevertheless, I would like to find a way to keep the Textbox Look and
posibility of using their properties.

All ideas welcome

Thanks

Joe Louis :(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top