Click here to Skip to main content
15,887,350 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I am trying to unzip all the files in a folder, but I am getting the error method 'namespace' of object 'ishelldispatch4' failed. Please help me to get this resolved.

Code below:
VB
Set objFSO = CreateObject("Scripting.FileSystemObject")
        Set objSubFolder = objFSO.GetFolder(pathToZipFile)
        Set objFiles = objSubFolder.Files

        For Each objFile In objFiles
            strfile = objFile.Path
            Set sa = CreateObject("Shell.Application")
            Set filesInzip = sa.Namespace(strfile).Items
            sa.Namespace(pathToZipFile).CopyHere (filesInzip)
        Next
Posted
Updated 15-May-12 4:16am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900