Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default 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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code fails when sheet is protected Tail Wind Excel Discussion (Misc queries) 3 September 4th 07 03:23 PM
Macro fails when worksheet protected George Tattam Excel Discussion (Misc queries) 5 February 9th 06 11:07 PM
MoveAfterReturn command fails in Worksheet module quartz[_2_] Excel Programming 1 April 1st 05 08:49 PM
MoveAfterReturn is tricking me. Ken McLennan[_3_] Excel Programming 4 October 9th 04 01:13 PM
VBa, Password protected sheet fails to get unprotected with the same password Hans Rattink Excel Programming 3 July 28th 03 02:30 PM


All times are GMT +1. The time now is 11:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"