open file, with winzip first

ermccarthy

Board Regular
Joined
Feb 15, 2002
Messages
224
I need a macro that will open a winzip file, in order to extract the specfic file located within. I have tried using the macro recorder in trying this, of course with no luck, and I can't find anything in my excel books.

Can anyone help me?????????



_________________
Russell
This message was edited by ermccarthy on 2002-03-01 15:34
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
On 2002-03-01 15:33, ermccarthy wrote:
I need a macro that will open a winzip file, in order to extract the specfic file located within. I have tried using the macro recorder in trying this, of course with no luck, and I can't find anything in my excel books.

Can anyone help me?????????



_________________
Russell
This message was edited by ermccarthy on 2002-03-01 15:34

Hi Russell

have a look here

http://www.mrexcel.com/board/viewtopic.php?topic=776&forum=2

Ivan
 
Upvote 0
OK so---I'm really dumb.....

The path to the zip file is:
H:FidelioFO_dataHistorySpool

This is where I would select the zip file, in this case 20010817.zip

And out of this zip file I need to open spool1.xls. No Changes will be made to the file, I am just going to copy the data to my current worksheet and close it, so I don't think I need to extract it.....

I can get this far:

SubZipFile()
Dim ZipPath as String
Dim ZipIt As String
Dim Source As String
Dim Dest As String

ZipPath="H:FidelioFO_dataHistorySpool"


From that point I get lost, I can handle the copy and paste routines, I am just lost getting this file to open.

PLEASE help!!!!I think I am actually a little more confused then when I started.
 
Upvote 0
Try

Function WinZipIt(Source As String, Target As String, zip As Boolean)
Dim ZipIt As String
Dim UnZipIt As String

ZipIt = "C:Program filesWinzip" & "winzip32 -a "
UnZipIt = "C:Program FilesWinzip" & "winzip32 -e "

If zip Then
Shell (ZipIt & Target & Source)
Else
Shell (UnZipIt & Target & Source)
End If

End Function

Sub TestZip()
WinZipIt " C:UnzippedFilesHere", " H:\Fidelio\FO_data\History\Spool\20010817.zip", False
End Sub

Ivan
 
Upvote 0
NB: Just noticed + read the MVP's forum

The / that show in my post should ONLY be
ONE there are extra "/" added.

Ivan
 
Upvote 0
Ivan, I had to make a small change to the macro you forwarded to me, as the winzip files are renamed with a suffix of spl instead of zip. It works great, but here is my delema, I need to specify which file to open, so I have made a cell on the worksheet (named ppfile1) that is where I will type in the file name I need to open (it is actually the date YYYYMMDD.spl) I can not seem to get it to work using the normal naming conventions I normally use in my programming,

any ideas on how to correct this??

Function WinZipIt(Source As String, Target As String, spl As Boolean)
Dim ZipIt As String
Dim UnZipIt As String

ZipIt = "C:Program filesWinzip" & "winzip32 -a "
UnZipIt = "C:Program FilesWinzip" & "winzip32 -e "

If spl Then
Shell (ZipIt & Target & Source)
Else
Shell (UnZipIt & Target & Source)
End If

End Function

Sub priorperiod()
filepp = Range("ppfile1").Value
WinZipIt " C:UnzippedFilesHere", filepp, False
''This is where I get a syntax error (filepp)''

End Sub

_________________
Russell
This message was edited by ermccarthy on 2002-03-03 13:46
 
Upvote 0

Forum statistics

Threads
1,213,511
Messages
6,114,054
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top