We help IT Professionals succeed at work.

Need vba  as unzip function is not executing .

vijay vj
vijay vj asked
on
61 Views
Last Modified: 2017-04-04
Dear sir , i have vba where its download the zip file from web to destination folder and its have to unzip and delete the zip file, i have vba code where its download the zip file but its not executing the unzip vba , kindly i need help to correct it..

thanks , i have attached my excel file.
NSE-OI-REPORT.xlsm
Comment
Watch Question

CERTIFIED EXPERT

Commented:
1/ in my testing, you need to ensure that gstDestinationFolder has a trailing \  for the Unzip routine to find the zip files

Private Sub CommandButton1_Click()
  bTrace = CheckBox1.Value
  bDelete = CheckBox1.Value
  dStartDate = Range("E6")
  dEndDate = Range("F6")
  sHTTP = Sheets("Sheet1").Range("B10")
  gstDestinationFolder = Range("C10")
  If bTesting Then gstDestinationFolder = ActiveWorkbook.Path & "\Temp\"
   If Right(gstDestinationFolder, 1) <> "\" Then gstDestinationFolder = gstDestinationFolder & "\"  '<<added

Open in new window


the target folder then ends up with the csv files.

another issue may be that the destination folder you have set is with the User area.  This may not have sufficent access rights.  I used C:\Temp\OI in my testing and csv files are there ok

Author

Commented:
But i have similar file which works perfectly as unzipped and formatting the csv file to txt file.
2.jpg
1.jpg
CERTIFIED EXPERT

Commented:
Open the VBE and make sure the URL is valid.
Whether it is or not will be printed to the immediate window.

Author

Commented:
The problem is zip files are directly downloading to the destination folder but , its not unzipping the files,i have vba code for unzip but its not working.. sir....
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
i have found solution , admin kindly close the question as no error in vba, i think
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.