Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Code to disable "paste" as an option

Hi Ron!

You have solved my problem!!
Thanks for your help with this!!

This is how the code turned out:

With ActiveWindow
Application.CommandBars(1).Enabled = False 'True to restore

.DisplayHeadings = False
.DisplayWorkbookTabs = False
End With
Application.CommandBars("Standard").Visible = False
Application.CommandBars("Formatting").Visible = False
Application.CommandBars("Drawing").Visible = False
Application.CommandBars("Visual Basic").Visible = False

For Each Ctl In CommandBars("Cell").Controls
Ctl.Enabled = False
Next Ctl
Application.CommandBars("cell").Controls. _
Add Type:=msoControlButton, ID:=370, befo=1
Set oCtls = CommandBars.FindControls(ID:=19) ''Copy
If Not oCtls Is Nothing Then
For Each oCtl In oCtls
oCtl.Enabled = True
Next
End If
With Application
.OnKey "^v", ""
.OnKey "^x", ""
.OnKey "+{Del}", ""
.CellDragAndDrop = False

End With
End Function
Function Auto_Close()

With ActiveWindow
Application.CommandBars(1).Enabled = True 'True to restore

.DisplayHeadings = False

End With
Application.CommandBars("Standard").Visible = True
Application.CommandBars("Formatting").Visible = True
Application.CommandBars("Drawing").Visible = True

Application.CommandBars("cell").Reset
With Application
.OnKey "^v"
.OnKey "^x"
.OnKey "+{Del}"
.CellDragAndDrop = True
End With

Application.Quit
End Function


//Thoma

--
Message posted from http://www.ExcelForum.com

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
How do i disable/enable "Worksheet Move or copy" option? Saon Excel Worksheet Functions 1 May 15th 08 06:30 PM
Disable collate "on" option? dogmelissa Excel Discussion (Misc queries) 4 December 15th 06 10:05 PM
Disable "save" option on close. PG Excel Discussion (Misc queries) 2 September 6th 06 12:15 AM
How to set a default paste option of "Match Destination Format" John H @ EBR Excel Discussion (Misc queries) 1 April 17th 06 09:59 PM
Modify code to disable "paste" Jonsson[_34_] Excel Programming 0 June 17th 04 09:10 AM


All times are GMT +1. The time now is 03:05 PM.

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

About Us

"It's about Microsoft Excel"