Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Working with NameSpace 1

Status
Not open for further replies.

JillB01

Technical User
Jan 25, 2008
2
AU
Can anyone please help me to make the NameSpace line in the code below work properly? Do I have to declare it, or define it in any way, or make a Reference?

I always get r-time error 91: "Object variable not set or With block not set"

any suggestions, ideas or advice gratefully received.


Code:
Public Function Unzip(DefPath, Fname)
'Unzips A File
'Fname must be FULL Path\Filename.zip
'DefPath must be valid Path you want to Unzip file TO

Dim FSO As Object
Dim oApp As Object

On Error GoTo UnZip_Err:
 
Set oApp = CreateObject("Shell.Application")

'Copy the files in the newly created folder
[b]oApp.Namespace(DefPath).CopyHere oApp.Namespace(Fname).items [/b]

On Error Resume Next
Set FSO = CreateObject("scripting.filesystemobject")
FSO.deletefolder Environ("Temp") & "\Temporary Directory*", True

Set oApp = Nothing
Set FSO = Nothing
Exit Function
 
Thanks for your help with this. I have actually found that the parameters passed have to be Variants, not Strings as I was using.
That fied the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top