for some reason this line of code is not working
Application.DisplayAlerts = False
when the line of code below runs i still get the alert about do i want to copy.
oApp.Namespace(FileNameFolder).CopyHere oApp.Namespace(Fname).items
why am I still getting the alert? if this is the wrong code, what is the right code please?
thanks smiler44
Application.DisplayAlerts = False
when the line of code below runs i still get the alert about do i want to copy.
oApp.Namespace(FileNameFolder).CopyHere oApp.Namespace(Fname).items
why am I still getting the alert? if this is the wrong code, what is the right code please?
thanks smiler44
Code:
Sub extract()
Dim FSO As Object
Dim oApp As Object
Dim Fname As Variant
Dim FileNameFolder As Variant
Dim DefPath As String
Application.DisplayAlerts = False
Fname = "C:\Users\Downloads\443.zip"
If Fname = False Then
'Do nothing
Else
'Destination folder
DefPath = "C:\Users\documents\adsl"
If Right(DefPath, 1) <> "\" Then
DefPath = DefPath & "\"
End If
FileNameFolder = DefPath
'Extract the files into the Destination folder
Set oApp = CreateObject("Shell.Application")
oApp.Namespace(FileNameFolder).CopyHere oApp.Namespace(Fname).items
' MsgBox "You find the files here: " & FileNameFolder
On Error Resume Next
Set FSO = CreateObject("scripting.filesystemobject")
FSO.deletefolder Environ("Temp") & "\Temporary Directory*", True
End If
Application.DisplayAlerts = True
End Sub