Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default I am trying to open a ".gz" file with a macro in Excel 2003.

Any help would be appreciated.
--
Joe D
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default I am trying to open a ".gz" file with a macro in Excel 2003.

..GZ is a gzip compressed file format. (http://www.gzip.org/) You need to
extract the excel file from this.

If this post helps click Yes
---------------
Jacob Skaria


"Joe D" wrote:

Any help would be appreciated.
--
Joe D

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default I am trying to open a ".gz" file with a macro in Excel 2003.

I have the 7zip software and can manuially open the files. I am looking for
code to uncompress them with VBA on a windows machine. Any ideas on this??

--
Joe D


"Jacob Skaria" wrote:

.GZ is a gzip compressed file format. (http://www.gzip.org/) You need to
extract the excel file from this.

If this post helps click Yes
---------------
Jacob Skaria


"Joe D" wrote:

Any help would be appreciated.
--
Joe D

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default I am trying to open a ".gz" file with a macro in Excel 2003.

Ron de Bruin has some sample code for zipping files he
http://www.rondebruin.nl/unzip.htm

You can this as the basis for your code--but he does use winzip. You'll have
some minor modifications to do.

Joe D wrote:

I have the 7zip software and can manuially open the files. I am looking for
code to uncompress them with VBA on a windows machine. Any ideas on this??

--
Joe D

"Jacob Skaria" wrote:

.GZ is a gzip compressed file format. (http://www.gzip.org/) You need to
extract the excel file from this.

If this post helps click Yes
---------------
Jacob Skaria


"Joe D" wrote:

Any help would be appreciated.
--
Joe D


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default I am trying to open a ".gz" file with a macro in Excel 2003.

Or if you want to use the Default zip program see
http://www.rondebruin.nl/windowsxpunzip.htm

Never test it for zip files with a gz extension

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Dave Peterson" wrote in message ...
Ron de Bruin has some sample code for zipping files he
http://www.rondebruin.nl/unzip.htm

You can this as the basis for your code--but he does use winzip. You'll have
some minor modifications to do.

Joe D wrote:

I have the 7zip software and can manuially open the files. I am looking for
code to uncompress them with VBA on a windows machine. Any ideas on this??

--
Joe D

"Jacob Skaria" wrote:

.GZ is a gzip compressed file format. (http://www.gzip.org/) You need to
extract the excel file from this.

If this post helps click Yes
---------------
Jacob Skaria


"Joe D" wrote:

Any help would be appreciated.
--
Joe D


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default I am trying to open a ".gz" file with a macro in Excel 2003.

I have tried modifying Ron's code but unfortunately have not been successful.
I can get it to find the gz files, but not the items inside the files. Any
suggestions would be appreciated.

Thanks
--
Joe D


"Dave Peterson" wrote:

Ron de Bruin has some sample code for zipping files he
http://www.rondebruin.nl/unzip.htm

You can this as the basis for your code--but he does use winzip. You'll have
some minor modifications to do.

Joe D wrote:

I have the 7zip software and can manuially open the files. I am looking for
code to uncompress them with VBA on a windows machine. Any ideas on this??

--
Joe D

"Jacob Skaria" wrote:

.GZ is a gzip compressed file format. (http://www.gzip.org/) You need to
extract the excel file from this.

If this post helps click Yes
---------------
Jacob Skaria


"Joe D" wrote:

Any help would be appreciated.
--
Joe D


--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default I am trying to open a ".gz" file with a macro in Excel 2003.

Without knowing what failed, I'm gonna make a guess that you didn't have the
commandline version of 7z (7za.exe).

You can find it he
http://sourceforge.net/project/downl...ip&use_mirror=

(I haven't used it in a long time, but I believe I went searching for this file
when I needed to do this, too.)

Anyway, this worked for me:

Option Explicit
Sub UnZip_GZFile()
Dim Path7Z As String, FileNameGZ As String
Dim ShellStr As String, FolderName As String

Path7Z = "C:\program files\7-zip\"
'This will check if this is the path where 7za is installed.
If Dir(Path7Z & "7za.exe") = "" Then
MsgBox "Please find your copy of 7za.exe and try again"
Exit Sub
End If

FileNameGZ = "C:\Data\Test.gz"
FolderName = "C:\Data\"

'Unzip the zip file in the folder FolderName
ShellStr = Path7Z & "7za.exe e" _
& " " & Chr(34) & FileNameGZ & Chr(34) _
& " -o" & Chr(34) & FolderName & Chr(34)

ShellAndWait ShellStr, vbHide

MsgBox "Look in " & FolderName & " for extracted files"
End Sub

Remember to include Ron's ShellAndWait code, too.

And after your data is extracted, you can use Dir() to look for what you want
(and open it???).

Joe D wrote:

I have tried modifying Ron's code but unfortunately have not been successful.
I can get it to find the gz files, but not the items inside the files. Any
suggestions would be appreciated.

Thanks
--
Joe D

"Dave Peterson" wrote:

Ron de Bruin has some sample code for zipping files he
http://www.rondebruin.nl/unzip.htm

You can this as the basis for your code--but he does use winzip. You'll have
some minor modifications to do.

Joe D wrote:

I have the 7zip software and can manuially open the files. I am looking for
code to uncompress them with VBA on a windows machine. Any ideas on this??

--
Joe D

"Jacob Skaria" wrote:

.GZ is a gzip compressed file format. (http://www.gzip.org/) You need to
extract the excel file from this.

If this post helps click Yes
---------------
Jacob Skaria


"Joe D" wrote:

Any help would be appreciated.
--
Joe D


--

Dave Peterson


--

Dave Peterson
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default I am trying to open a ".gz" file with a macro in Excel 2003.

FYI

I add the Zip page today for 7-zip
http://www.rondebruin.nl/7zipwithexcel.htm

Next week I will create the Unzip page



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Joe D" wrote in message ...
I have the 7zip software and can manuially open the files. I am looking for
code to uncompress them with VBA on a windows machine. Any ideas on this??

--
Joe D


"Jacob Skaria" wrote:

.GZ is a gzip compressed file format. (http://www.gzip.org/) You need to
extract the excel file from this.

If this post helps click Yes
---------------
Jacob Skaria


"Joe D" wrote:

Any help would be appreciated.
--
Joe D

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default I am trying to open a ".gz" file with a macro in Excel 2003.

Will this help http://www.math.mcmaster.ca/~grasselli/john.pdf

If this post helps click Yes
---------------
Jacob Skaria


"Joe D" wrote:

Any help would be appreciated.
--
Joe D

  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default I am trying to open a ".gz" file with a macro in Excel 2003.

Sorry the below is meant for a different post.
--
If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Will this help http://www.math.mcmaster.ca/~grasselli/john.pdf

If this post helps click Yes
---------------
Jacob Skaria


"Joe D" wrote:

Any help would be appreciated.
--
Joe D



  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default I am trying to open a ".gz" file with a macro in Excel 2003.

Hi Joe

Play with it for a few minutes

You can use -y to overwrite the files if they exist

ShellStr = Path7Z & "7z.exe e -y" _
& " " & Chr(34) & FileNameGZ & Chr(34) _
& " -o" & Chr(34) & FolderName & Chr(34)

Or use one of the other options below like this

ShellStr = Path7Z & "7z.exe e -aou" _
& " " & Chr(34) & FileNameGZ & Chr(34) _
& " -o" & Chr(34) & FolderName & Chr(34)

-aoa Overwrite All existing files without prompt.
-aos Skip extracting of existing files.
-aou aUto rename extracting file (for example, name.txt will be renamed to name_1.txt).
-aot auto rename existing file (for example, name.txt will be renamed to name_1.txt).





--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Joe D" wrote in message ...
Any help would be appreciated.
--
Joe D

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
" %20" signs in file name when open attachement in excel traveler Excel Discussion (Misc queries) 1 October 5th 07 08:26 AM
"Cannot access read-only document" (I get this error when I try to open an Excel file) [email protected] Excel Discussion (Misc queries) 1 June 5th 06 01:15 PM
"Cannot access read-only document" (I get this error when I try to open an Excel file) [email protected] Setting up and Configuration of Excel 1 June 5th 06 01:15 PM
Excel 2002/2003 can not open xls file says "may be read only" Number6 Excel Discussion (Misc queries) 3 December 20th 05 05:25 PM


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

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

About Us

"It's about Microsoft Excel"