I have a problem
case 1:
downloadFolder = "C:\Users\ACER\AppData\Local\Temp\"
If Not shellApp.Namespace(downloadFolder) Is Nothing Then
MsgBox "Success"
Else
MsgBox "Error: " & downloadFolder
End If`
===>>>> output: "Error: C:\Users\ACER\AppData\Local\Temp"
case 2:
If Not shellApp.Namespace("C:\Users\ACER\AppData\Local\Temp\") Is Nothing Then
MsgBox "Success"
Else
MsgBox "Error: " & downloadFolder
End If`
===>>>> output: "Success"
shellApp.Namespace expects a variant as argument. If 'downloadFolder' was defined as string, this "error" will happens.
For instance:
Dim downloadFolder as String
downloadFolder = "C:\Users\ACER\AppData\Local\Temp\"
If Not shellApp.Namespace(downloadFolder) Is Nothing Then
MsgBox "Success"
Else
MsgBox "Error: " & downloadFolder
End If
will return "Error: C:\Users\ACER\AppData\Local\Temp"
To avoid it, you can define 'downloadFolder' as Variant:
Dim downloadFolder as Variant
Or put 'downloadFolder' between parentheses, like this:
If (Not shellApp.Namespace((downloadFolder)) Is Nothing) Then