Hello,
I have the following code to unzip a .zip file that is attached to an email. My goal is to save this down as the .xls file within and delete the email. The portion of the code dealing with unzipping the attachment is below.
The final line keeps returning on 'object or with variable not set' error, even though as you can see, I set oApp.
Can anyone spot where I've gone wrong? Thanks!
I have the following code to unzip a .zip file that is attached to an email. My goal is to save this down as the .xls file within and delete the email. The portion of the code dealing with unzipping the attachment is below.
Code:
Dim oApp As Object
Dim FSO As Object
Dim FileNameFolder As Variant
Dim StockReportLocation as String
Dim MyDate as String
Dim Filename as string
StockReportLocation=\\filepathgoeshere
MyDate="YYMMDD"
Set oApp = CreateObject("Shell.Application") 'unzip file
FileName = Location & MyDate & " NameGoesHere.xls"
oApp.Namespace(FileNameFolder).copyhere oApp.Namespace(Atmt.FileName).Items
The final line keeps returning on 'object or with variable not set' error, even though as you can see, I set oApp.
Can anyone spot where I've gone wrong? Thanks!