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
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