Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default event procedure

Hi,
I am using the following in a Worksheet, to prevent the user from using the
fill handle on that particular sheet:

Private Sub Worksheet_Activate()
Application.CellDragAndDrop = False
End Sub

Private Sub Worksheet_Deactivate()
Application.CellDragAndDrop = True
End Sub

However, if the workbook is saved with this sheet active, closed, then
opened, the macro doesn't fire. How can I prevent this from occurring?

Regards - Dave.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default event procedure

Don't let the user save the file with that special worksheet active.

Use the Workbook BeforeSave event to move off the sheet (to an alternative
sheet) prior to saving. When the file is re-opened, it will open with the
alternative sheet active. The user will have to select the special sheet and
the worksheet activate event code will trigger.


--
Gary''s Student - gsnu200796


"Dave" wrote:

Hi,
I am using the following in a Worksheet, to prevent the user from using the
fill handle on that particular sheet:

Private Sub Worksheet_Activate()
Application.CellDragAndDrop = False
End Sub

Private Sub Worksheet_Deactivate()
Application.CellDragAndDrop = True
End Sub

However, if the workbook is saved with this sheet active, closed, then
opened, the macro doesn't fire. How can I prevent this from occurring?

Regards - Dave.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,388
Default event procedure

Hi GS,
Yeah, of course. D'uh. Thanks.
Regards - Dave.

"Gary''s Student" wrote:

Don't let the user save the file with that special worksheet active.

Use the Workbook BeforeSave event to move off the sheet (to an alternative
sheet) prior to saving. When the file is re-opened, it will open with the
alternative sheet active. The user will have to select the special sheet and
the worksheet activate event code will trigger.


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
Event Procedure doesn't run pat59 Excel Programming 3 July 19th 06 04:00 PM
change event procedure natanz[_2_] Excel Programming 0 November 4th 05 03:42 AM
Event Procedure Paul Johnson[_2_] Excel Programming 1 February 2nd 05 01:29 PM
Event Procedure again Paul Johnson[_2_] Excel Programming 1 February 2nd 05 01:28 PM
OnTime event not firing in Workbook_Open event procedure GingerTommy Excel Programming 0 September 24th 03 03:18 PM


All times are GMT +1. The time now is 04:12 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"