Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default Want to Unzip files automatically

Hi,

I want to open some Zipped files through VBA (Excel) and then unzip them to
my target folder.
I got ready made stuff for me from Ron de Bruin's site
http://www.rondebruin.nl/unzip.htm#zip

But the problem is ....I have Windows XP and probably zipping is integrated
in to XP so for me
the statement "Pathwinzip = .." doesnt make sense. Also, within ShellStr it
did not make sense to me
to include pathname so, I modified the above code to the following...

Sub UnZip_ZipFile_1change()
Dim PathWinZip As String, FileNameZip As String
Dim ShellStr As String, FolderName As String

FileNameZip = "C:\Documents and Settings\abc\Desktop\DEV1_1022.zip"
FolderName = "C:\Documents and Settings\abc\Desktop\Unzipped data"

ShellStr = FileNameZip & Chr(34) _
& " " & Chr(34) & FolderName & Chr(34)
ShellAndWait ShellStr, vbHide
MsgBox "Look in " & FolderName & " for extracted files"
End Sub

But by doing that, VBA displays an error "Run-time error '53': File not
found" when it is processing "hProg = shell(PathName, WindowState)" within
Public Sub ShellAndWait .

(I didnt want to make the mail very big, so didnt paste Ron's actual code
here. If that is not a correct practice please tell me so and in future I
would paste the 'source-code' as well)

--
Thanks a lot,
Hari
India


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Want to Unzip files automatically

Hi Hari

http://www.rondebruin.nl/zip.htm
http://www.rondebruin.nl/unzip.htm#zip

From my site

The examples are only working If you use WinZip as your Zip program.
(Note: you must have a registered copy of WinZip)


As far as i know you can't run the Windows Xp zip program with code

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Hari" wrote in message ...
Hi,

I want to open some Zipped files through VBA (Excel) and then unzip them to
my target folder.
I got ready made stuff for me from Ron de Bruin's site
http://www.rondebruin.nl/unzip.htm#zip

But the problem is ....I have Windows XP and probably zipping is integrated
in to XP so for me
the statement "Pathwinzip = .." doesnt make sense. Also, within ShellStr it
did not make sense to me
to include pathname so, I modified the above code to the following...

Sub UnZip_ZipFile_1change()
Dim PathWinZip As String, FileNameZip As String
Dim ShellStr As String, FolderName As String

FileNameZip = "C:\Documents and Settings\abc\Desktop\DEV1_1022.zip"
FolderName = "C:\Documents and Settings\abc\Desktop\Unzipped data"

ShellStr = FileNameZip & Chr(34) _
& " " & Chr(34) & FolderName & Chr(34)
ShellAndWait ShellStr, vbHide
MsgBox "Look in " & FolderName & " for extracted files"
End Sub

But by doing that, VBA displays an error "Run-time error '53': File not
found" when it is processing "hProg = shell(PathName, WindowState)" within
Public Sub ShellAndWait .

(I didnt want to make the mail very big, so didnt paste Ron's actual code
here. If that is not a correct practice please tell me so and in future I
would paste the 'source-code' as well)

--
Thanks a lot,
Hari
India




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
zip/unzip excel files SHANTA MENON Excel Discussion (Misc queries) 3 July 30th 08 10:10 PM
Unzip fuction in excel Willy Excel Worksheet Functions 1 April 17th 08 12:49 AM
unzip/zip xlsx files burrowsUW Excel Discussion (Misc queries) 3 March 11th 07 06:50 PM
How do I Unzip the files in "ExcelMap-China-Region.Zip" into your Sukesh New Users to Excel 1 December 8th 06 06:12 PM
Batch files auto unzip Jonathan Jones Excel Programming 3 October 16th 04 02:15 PM


All times are GMT +1. The time now is 09:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"