View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jose luis jose luis is offline
external usenet poster
 
Posts: 1
Default Activate method of OLEObject failed


Hi Forum

1. I implemented a worksheet with several Text Boxes from Controls
Toolbox.

2. To navigate around the Text Boxes , used a Bob Phillips
recommendation (thanks again Bob) that worked very well.


Code:
--------------------
How to jump between TextBoxes

--------------------------------------------------------------------------------

Here is a way

Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, _
ByVal Shift As Integer)
Dim bBackwards As Boolean


Select Case KeyCode
Case vbKeyTab, vbKeyReturn, vbKeyDown, vbKeyUp
Application.ScreenUpdating = False
bBackwards = CBool(Shift And 1) Or (KeyCode = vbKeyUp)
'Excel 97 must select cell before activating another control.
If Application.Version < 9 Then Sheet1.Range("A1").Select
If bBackwards Then
TextBox3.Activate
Else
TextBox2.Activate
End If
Application.ScreenUpdating = True
End Select
End Sub
--------------------


3. My problems began when i "shared" the worksheet, everything works
well except when i tried to navigate using the enter, tab or arrows for
which i coded.
In that cases i receive the "run time error 1004" Activate method of
OLEObject class failed.

4. Could not see where the trouble araises because the "shared feature"
that prevents me from seeing the VBA code.

Could you give some directions or strategies on how to proceed to avoid
this error.

As allways thanks for your advice.

Regards

Jose Luis


--
jose luis
------------------------------------------------------------------------
jose luis's Profile: http://www.excelforum.com/member.php...o&userid=13312
View this thread: http://www.excelforum.com/showthread...hreadid=376198