Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to open a zip file and extract its contents in a macro?
Hi
I need to save space in my hard disk so i have to zip some files, but i need them for consulting values and make some reports, i need to run a macro that opens the zip file, extract the workbook copy some values from it and then close it without making changes, and close the zip file. The zip file and the workbook have the same name. This operation is done by hand 5 times everyday so you'll understand my need. Please any help is needed |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to open a zip file and extract its contents in a macro?
Hard drive space is pretty cheap nowadays. It might be easier just investing a
few bucks into a larger HD. But there are command line versions of the unzipping programs. (I think PKZip (www.pkzip.com) has a version.) You could use a shellandwait routine to unzip the file. http://support.microsoft.com/?kbid=214248 XL2000: How to Force Macro Code to Wait for Outside Procedure Here's a link to a nice ShellAndWait function that does that. http://groups.google.com/groups?thre...%40tkmsftngp03 Then open that workbook, copy the data you want, close without saving and kill the file. dim wkbk as workbook set wkbk = workbooks.open(filename:=whateveryouextracteditto) wkbk.worksheets("sheet1").range("b1:C99").copy _ destination:= thisworkbook.worksheets("sheet99").range("x7") wkbk.close savechanges:=false kill whateveryouextracteditto might give you an idea. "Audie G. Bencosme R." wrote: Hi I need to save space in my hard disk so i have to zip some files, but i need them for consulting values and make some reports, i need to run a macro that opens the zip file, extract the workbook copy some values from it and then close it without making changes, and close the zip file. The zip file and the workbook have the same name. This operation is done by hand 5 times everyday so you'll understand my need. Please any help is needed -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Open Excel file from VB and open MACRO | Excel Discussion (Misc queries) | |||
2007 Macro to Open File, Delete Contents, Save New File | Excel Discussion (Misc queries) | |||
How to save file in a macro taking new name from cell contents? | Excel Discussion (Misc queries) | |||
Macro to extract clip-art file? | Excel Discussion (Misc queries) | |||
Automate open file, update links, run macro, close and save file | Excel Programming |