Hello Everyone...I am new to this site and am looking for help. Haven't been programming much more than a year - so much to learn!

I am working on importing files from a zipped folder. I will paste the code below - the problem is I am getting run time error 91 when I get to the line of code in red. I believe the issue is the Namespace and I don't know how to Dim it or what to set it to.

What am I doing wrong/missing? Thank you for any guidance you can provide.

Lrn2Code


Dim cFileZip As Variant
Dim cDestination As String
Dim o As Object
Dim ofile As Object
Dim Namespace As Recordset
Set Namespace = New Recordset
'Set Namespace = Nothing
'SETTING THIS AS RECORDSET TO SEE IF IMPORT WILL WORK 7-21-09
'Set Namespace = Nothing
'Set ofile = Nothing



cFileZip = "C:\Stat\FY09\ToImport\FilesforDOE.Zip"
cDestination = "C:\Stat\FY09\ToImport\FilesforDOE\"
'cDestination = cDestination + "\" + "FilesforDOE\"


Set o = CreateObject("shell.application")
For Each ofile In o.Namespace(cFileZip).items
o.Namespace(cDestination).copyhere(ofile).items
Next