Pasedo, boa tarde.
O problema que você esta utilizando uma versão do
Office 64 bits e, nesse caso, deverá adaptar o código para funcionar nas duas versões (
32 bits e 64 bits).
Para isso, substitua a parte do código:
Código: Selecionar todos
Private Declare PtrSafe Function EmptyRecycleBin Lib "shell32.dll" _
Alias "SHEmptyRecycleBinA" ( _
ByVal hwnd As Long, _
ByVal pszRootPath As String, _
ByVal dwFlags As Long) As Long
Pelas linhas de código abaixo:
Código: Selecionar todos
#If VBA7 Then
Private Declare PtrSafe Function EmptyRecycleBin Lib "shell32.dll" _
Alias "SHEmptyRecycleBinA" ( _
ByVal hwnd As Long, _
ByVal pszRootPath As String, _
ByVal dwFlags As Long) As Long
#ElseIf VBA6 Then
Private Declare Function EmptyRecycleBin Lib "shell32.dll" _
Alias "SHEmptyRecycleBinA" ( _
ByVal hwnd As Long, _
ByVal pszRootPath As String, _
ByVal dwFlags As Long) As Long
#End If
Dessa forma, irá funcionar sem problema.
Se tiver outras dúvidas, estou a disposição.