Hi Harry 1 are all the workbooks in xlsm or xls format is it possible for u to share a sample workbook
On Tue, Sep 20, 2011 at 1:28 AM, HarryP Knuckles <kent.bouc...@tbs-sct.gc.ca > wrote: > Good afternoon, > > I have 20,000 workbooks that are going to be returned to me shortly > and i need a template from which i can open the workbooks > (individually) and have a marco to perform three necessary functions > on all of these workbooks (each workbook will have a unique name). My > objective is to: > > > 1) Unprotect the workbooks. > 2) Unprotect the worksheets. > 3) Disable a macro that is in each of the original workbooks (20,000) > designed to prevent right click, cut, copy and paste. > > > I have included below the macro that is present in all 20,000 > workbooks that i need to have diabled through the new template > workbook. Can you folks provide some guidance as to how i can > complete > this task using a template. > Your help is greatly appreciated!!! > > ___________________________________________________________________________ > ________________ > > > Private Sub Workbook_Activate() > Application.CutCopyMode = False > Application.OnKey "^c", "" > Application.CellDragAndDrop = False > Application.CommandBars("Ply").Controls("View Code").Enabled = False > End Sub > > > Private Sub Workbook_Deactivate() > Application.CellDragAndDrop = True > Application.OnKey "^c" > Application.CutCopyMode = False > End Sub > > > Private Sub Workbook_WindowActivate(ByVal Wn As Window) > Application.CutCopyMode = False > Application.OnKey "^c", "" > Application.CellDragAndDrop = False > End Sub > > > Private Sub Workbook_WindowDeactivate(ByVal Wn As Window) > Application.CellDragAndDrop = True > Application.OnKey "^c" > Application.CutCopyMode = False > End Sub > > > Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal > Target As Range, Cancel As Boolean) > Cancel = True > MsgBox "Right click menu deactivated." & vbCrLf & _ > "Cannot copy or ''drag & drop''.", 16, "For this workbook:" > End Sub > > > Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal > Target As Range) > Application.CutCopyMode = False > End Sub > > > Private Sub Workbook_SheetActivate(ByVal Sh As Object) > Application.OnKey "^c", "" > Application.CellDragAndDrop = False > Application.CutCopyMode = False > End Sub > > > Private Sub Workbook_SheetDeactivate(ByVal Sh As Object) > Application.CutCopyMode = False > End Sub > > -- > > ---------------------------------------------------------------------------------- > Some important links for excel users: > 1. Follow us on TWITTER for tips tricks and links : > http://twitter.com/exceldailytip > 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 > 3. Excel tutorials at http://www.excel-macros.blogspot.com > 4. Learn VBA Macros at http://www.quickvba.blogspot.com > 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com > > To post to this group, send email to excel-macros@googlegroups.com > > <><><><><><><><><><><><><><><><><><><><><><> > Like our page on facebook , Just follow below link > http://www.facebook.com/discussexcel > -- *Regards* * * *Ashish Koul* *http://www.excelvbamacros.com/* P Before printing, think about the environment. -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel