Bonjour,
J'ai besoin de votre aide pour supprimer des macros que j'avais activées dans un fichier excel afin que des assistantes commerciales ne puissent pas faire n'importe quoi avec ce fichier.
J'ai créé cette macro avec votre aide sur ce forum il y a quelques années.
Je pensais qu'en supprimant simplement la macro tout fonctionnerais normalement mais a priori ce n'est pas le cas.
Je souhaiterais donc avoir votre aide pour supprimer les macros et leurs actions afin de retrouver un fichier neutre et retrouver mes fonctions de copier/coller ctrl v etc....
Voici la macro que j'avais créer avec l'aide :
Sub ToggleCutCopyAndPaste(Allow As Boolean)
'Activate/deactivate cut, copy, paste and pastespecial menu items
Call EnableMenuItem(21, Allow) ' cut
Call EnableMenuItem(19, Allow) ' copy
Call EnableMenuItem(22, Allow) ' paste
Call EnableMenuItem(755, Allow) ' pastespecial
'Activate/deactivate drag and drop ability
Application.CellDragAndDrop = Allow
'Activate/deactivate cut, copy, paste and pastespecial shortcut keys
With Application
Select Case Allow
Case Is = False
.OnKey "^v", "CutCopyPasteEnable"
.OnKey "^x", "CutCopyPasteEnable"
.OnKey "+{DEL}", "CutCopyPasteEnable"
.OnKey "^{INSERT}", "CutCopyPasteEnable"
Case Is = True
.OnKey "^v"
.OnKey "^x"
.OnKey "+{DEL}"
.OnKey "^{INSERT}"
End Select
End With
End Sub
Sub EnableMenuItem(ctlId As Integer, Enabled As Boolean)
'Activate/Deactivate specific menu item
Dim cBar As CommandBar
Dim cBarCtrl As CommandBarControl
For Each cBar In Application.CommandBars
If cBar.Name <> "Clipboard" Then
Set cBarCtrl = cBar.FindControl(ID:=ctlId, recursive:=True)
If Not cBarCtrl Is Nothing Then cBarCtrl.Enabled = Enabled
End If
Next
End Sub
Sub CutCopyPasteEnable()
'Inform user that the functions have been disabled
MsgBox "Désolé, cette fonction est désactivée! Faire Clic Droit puis selectionner Respecter la mise en forme de destination!"
End Sub