Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Does anyone know how to programmatically disable Application.xlcut

I have had some problems maintaining formula integrity within a customized Excel application that is distibuted to multiple users (~100) when a user cuts and pastes a cell into another location.

Often this is done accidentally with a quick right, then left mouse click (especially on a laptop); but to fix the problem I have to remote into the user's machine to realign the formulas!!

Does anyone know of a way to disable the cut function, and perhaps change the application mode to xlcopy?

What I need to know is how would you isolate and approach the action -- the sheet is not changed until after the paste -- where would you put the module?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 94
Default Does anyone know how to programmatically disable Application.xlcut

Below are a few options or approaches to your problem.

1) Disable the DrapAndDrop property to eliminate your stated right-click /
left-click mouse problem.
Application.CellDragAndDrop = False

2) Intercept the mouse right-click and cancel it. The worksheet has a
predefined "BeforeRightClick" event that can be trapped (you can also use
WithEvents and a Class module to sink the "BeforeRightClick" event for the
entire workbook and Excel application).

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
'''Intercept and cancel the mouse right-click.
Cancel = True
End Sub

3) Cancel any pending "cut" when the user moves to a new cell. Once again,
this worksheet event can be applied across the entire Excel application by
sinking the events using a Class module and WithEvents.

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Application.CutCopyMode = xlCut Then
Application.CutCopyMode = False
End If
End Sub

4) Use Worksheet protection to protect locked cells.

Troy


"Fonda" wrote in message
...
I have had some problems maintaining formula integrity within a customized

Excel application that is distibuted to multiple users (~100) when a user
cuts and pastes a cell into another location.

Often this is done accidentally with a quick right, then left mouse click

(especially on a laptop); but to fix the problem I have to remote into the
user's machine to realign the formulas!!

Does anyone know of a way to disable the cut function, and perhaps change

the application mode to xlcopy?

What I need to know is how would you isolate and approach the action --

the sheet is not changed until after the paste -- where would you put the
module?


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
Disable macros on a programmatically opening .xls file Matt[_2_] Excel Discussion (Misc queries) 2 May 25th 07 04:45 AM
macro to close excel application other than application.quit mary Excel Programming 1 September 14th 04 03:43 PM
application.quit will not shut off application john Excel Programming 0 January 9th 04 11:29 PM
Programmatically Add Reference` Jean-Paul Viel Excel Programming 0 September 16th 03 02:23 PM
Can i set a reference programmatically? Tom Ogilvy Excel Programming 1 August 19th 03 04:24 PM


All times are GMT +1. The time now is 06:44 PM.

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"