Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Disable Pasting into a Workbook
Hi
I have a workbook, Wb1. I would like to be able to copy from Wb1 and paste to any other Wb but disable pasting into Wb1. -- Cheers Scotty |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Disable Pasting into a Workbook
http://www.j-walk.com/ss/excel/faqs/protectionFAQ.htm
Regards, Ryan-- -- RyGuy "scottyboy" wrote: Hi I have a workbook, Wb1. I would like to be able to copy from Wb1 and paste to any other Wb but disable pasting into Wb1. -- Cheers Scotty |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Disable Pasting into a Workbook
I have compiled the below code, when i copy from wb1 and go to copy into wb2
paste option is not available unless i open a new excel session. Think it may have something to do with the clipboard. Any suggestions? Public Switching As Boolean Private Sub Workbook_activate() DisableCutAndPaste Switching = True End Sub Private Sub Workbook_Deactivate() EnableCutAndPaste Switching = True End Sub Private Sub DisableCutAndPaste() EnableControl 21, False ' cut EnableControl 19, True ' copy EnableControl 22, False ' paste EnableControl 755, False ' pastespecial Application.OnKey "^c" Application.OnKey "^v", "" Application.OnKey "+{DEL}", "" Application.OnKey "+{INSERT}", "" Application.CellDragAndDrop = False End Sub Private Sub EnableCutAndPaste() EnableControl 21, True ' cut EnableControl 19, True ' copy EnableControl 22, True ' paste EnableControl 755, True ' pastespecial Application.OnKey "^c" Application.OnKey "^v" Application.OnKey "+{DEL}" Application.OnKey "+{INSERT}" Application.CellDragAndDrop = True End Sub Private Sub EnableControl(Id As Integer, Enabled As Boolean) Dim CB As CommandBar Dim C As CommandBarControl For Each CB In Application.CommandBars Set C = CB.FindControl(Id:=Id, recursive:=True) If Not C Is Nothing Then C.Enabled = Enabled Next End Sub Private Sub Workbook_Open() Application.ScreenUpdating = False For i = 1 To Worksheets.Count Sheets(i).Visible = True Next i Sheets("Warning").Visible = xlVeryHidden Application.ScreenUpdating = True End Sub Private Sub Workbook_beforeClose(Cancel As Boolean) Application.ScreenUpdating = False For i = 1 To Worksheets.Count Sheets("Warning").Visible = True If Sheets(i).Visible = True And Sheets(i).Name < "Warning" Then Sheets(i).Visible = xlVeryHidden End If Next i Application.DisplayAlerts = False EnableCutAndPaste End Sub -- Cheers Scotty "ryguy7272" wrote: http://www.j-walk.com/ss/excel/faqs/protectionFAQ.htm Regards, Ryan-- -- RyGuy "scottyboy" wrote: Hi I have a workbook, Wb1. I would like to be able to copy from Wb1 and paste to any other Wb but disable pasting into Wb1. -- Cheers Scotty |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
URGENT - Disable links in a shared workbook | Links and Linking in Excel | |||
Disable print option of a worksheet/workbook | Excel Discussion (Misc queries) | |||
Can you disable the save function from a shared workbook | Excel Discussion (Misc queries) | |||
Disable VBA code execution when loading a workbook | Excel Discussion (Misc queries) | |||
Disable macro security for selected workbook | Excel Discussion (Misc queries) |