1 2 3 4 5 6 7 8 9 10
| Private Sub REG_Click()
' LA version d'office (12.0) est a adapter
Dim Ws As Object
Set Ws = CreateObject("Wscript.Shell")
Ws.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Security\Trusted Locations\Location6\Path", ThisWorkbook.Path 'Valeur chaine
Ws.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Security\Trusted Locations\Location6\AllowSubfolders", 1, "REG_DWORD" 'Valeur REG_DWORD
Ws.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Security\Trusted Locations\Location6\Date", Now 'Valeur chaine
Ws.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Security\Trusted Locations\Location6\Description", "" 'Valeur chaine
MsgBox "L'emplacement: [" & ThisWorkbook.Path & "] a été ajouté a la liste des emplacements approuvés ainsi que ses sous-répertoires"
End Sub |
Partager