Closed Thread
Results 1 to 3 of 3

[SOLVED] MoveAfterReturn fails because sheet is protected

  1. #1
    quartz
    Guest

    [SOLVED] MoveAfterReturn fails because sheet is protected

    I am using Windows XP with Office 2003.
    I have the following programs in a sheet module:

    Private Sub Worksheet_Activate()
    Application.MoveAfterReturn = False
    End Sub
    Private Sub Worksheet_Deactivate()
    Application.MoveAfterReturn = True
    End Sub

    But, when the sheet is activated, the cell pointer still moves after enter.
    This failure only occurs if the sheet is protected. I want it to work when
    the sheet is protected.
    How can I get this to work?

    Thanks in advance for your assistance.

  2. #2
    Jim Thomlinson
    Guest

    RE: MoveAfterReturn fails because sheet is protected

    The code works fine on my machine... You mention that the code is in a sheet
    module. Just to clarify... It is in a sheet? Not in a module.

    Try putting break points on the procedures or put a message box in the
    procedure just to make sure the events are firing.

    Speaking of event firing... in your code anywhere do you toggle the

    Application.enableevents = false

    without setting it back.

    Application.enableevents = true

    If your events are off you are hooped and will have to reset them.

    HTH

    "quartz" wrote:

    > I am using Windows XP with Office 2003.
    > I have the following programs in a sheet module:
    >
    > Private Sub Worksheet_Activate()
    > Application.MoveAfterReturn = False
    > End Sub
    > Private Sub Worksheet_Deactivate()
    > Application.MoveAfterReturn = True
    > End Sub
    >
    > But, when the sheet is activated, the cell pointer still moves after enter.
    > This failure only occurs if the sheet is protected. I want it to work when
    > the sheet is protected.
    > How can I get this to work?
    >
    > Thanks in advance for your assistance.


  3. #3
    quartz
    Guest

    RE: MoveAfterReturn fails because sheet is protected

    Jim,

    Thanks for your reply. Events are not disabled anywhere in my code. The only
    cells that are unlocked are those on a single row. It is strange that this
    works if the sheet is not protected...

    "Jim Thomlinson" wrote:

    > The code works fine on my machine... You mention that the code is in a sheet
    > module. Just to clarify... It is in a sheet? Not in a module.
    >
    > Try putting break points on the procedures or put a message box in the
    > procedure just to make sure the events are firing.
    >
    > Speaking of event firing... in your code anywhere do you toggle the
    >
    > Application.enableevents = false
    >
    > without setting it back.
    >
    > Application.enableevents = true
    >
    > If your events are off you are hooped and will have to reset them.
    >
    > HTH
    >
    > "quartz" wrote:
    >
    > > I am using Windows XP with Office 2003.
    > > I have the following programs in a sheet module:
    > >
    > > Private Sub Worksheet_Activate()
    > > Application.MoveAfterReturn = False
    > > End Sub
    > > Private Sub Worksheet_Deactivate()
    > > Application.MoveAfterReturn = True
    > > End Sub
    > >
    > > But, when the sheet is activated, the cell pointer still moves after enter.
    > > This failure only occurs if the sheet is protected. I want it to work when
    > > the sheet is protected.
    > > How can I get this to work?
    > >
    > > Thanks in advance for your assistance.


Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1