Lrn2Code
Registered User.
- Local time
- Today, 11:02
- Joined
- Dec 8, 2008
- Messages
- 56
Hello All,
I'm still trying to figure out my unzip files code that doesn't want to work. Am not sure if the "file exists error" is gone because I can't get that far into the code. Now the problem is I am getting run time error 91 "Object variable or With block variable not set" on the unzip code. I don't understand what that message means.
Have pasted the code below with the error line highlighted in red.
What am I missing? This is driving me nutz!
Thanks for your help.
Dim cFileZip As Variant
Dim cDestination As String
Dim o As Object
Dim ofile As Object
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).copyfile(ofile).items
Next
I'm still trying to figure out my unzip files code that doesn't want to work. Am not sure if the "file exists error" is gone because I can't get that far into the code. Now the problem is I am getting run time error 91 "Object variable or With block variable not set" on the unzip code. I don't understand what that message means.
Have pasted the code below with the error line highlighted in red.
What am I missing? This is driving me nutz!
Thanks for your help.
Dim cFileZip As Variant
Dim cDestination As String
Dim o As Object
Dim ofile As Object
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).copyfile(ofile).items
Next