Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Zipping Excel files

Hi There,

I am trying to create a vba macro to automatically zip my
all excel file with use of SHELL command in vba but I am
unsuccessful. Can anyone check my code and tell me what's
wrong with it. What it does I am trying to use the
current date as my zip filename. When I run it seems
nothing happened and gives no error.

Sub ZIPMYFILE()
TempoFileDIR = Format(now, "yyyymmdd_hhmmss")

Dim TodaysArchive As String
Dim aBatchCopy As String
TodaysArchive = iArchivePath & TempoFileDIR & ".zip"
& " " & cWorkingPath
aBatchCopy = ("cmd /c PKZIPC -add -
directories=relative " & TodaysArchive)
Call Shell(aBatchCopy, vbHide)

End sub

TIA
Eric


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

See a example on my site Eric
I will release my new SendMail Add-in soon (this can zip also)

http://www.rondebruin.nl/sendmail.htm#Zip


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Eric" wrote in message ...
Hi There,

I am trying to create a vba macro to automatically zip my
all excel file with use of SHELL command in vba but I am
unsuccessful. Can anyone check my code and tell me what's
wrong with it. What it does I am trying to use the
current date as my zip filename. When I run it seems
nothing happened and gives no error.

Sub ZIPMYFILE()
TempoFileDIR = Format(now, "yyyymmdd_hhmmss")

Dim TodaysArchive As String
Dim aBatchCopy As String
TodaysArchive = iArchivePath & TempoFileDIR & ".zip"
& " " & cWorkingPath
aBatchCopy = ("cmd /c PKZIPC -add -
directories=relative " & TodaysArchive)
Call Shell(aBatchCopy, vbHide)

End sub

TIA
Eric




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Zipping Excel files

Oops

You are using PKZIPC
I am not familiar with this program


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Ron de Bruin" wrote in message ...
See a example on my site Eric
I will release my new SendMail Add-in soon (this can zip also)

http://www.rondebruin.nl/sendmail.htm#Zip


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Eric" wrote in message ...
Hi There,

I am trying to create a vba macro to automatically zip my
all excel file with use of SHELL command in vba but I am
unsuccessful. Can anyone check my code and tell me what's
wrong with it. What it does I am trying to use the
current date as my zip filename. When I run it seems
nothing happened and gives no error.

Sub ZIPMYFILE()
TempoFileDIR = Format(now, "yyyymmdd_hhmmss")

Dim TodaysArchive As String
Dim aBatchCopy As String
TodaysArchive = iArchivePath & TempoFileDIR & ".zip"
& " " & cWorkingPath
aBatchCopy = ("cmd /c PKZIPC -add -
directories=relative " & TodaysArchive)
Call Shell(aBatchCopy, vbHide)

End sub

TIA
Eric






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
Navigating to Excel files over network slow, but not Word files Newbie123 Excel Discussion (Misc queries) 1 December 2nd 09 01:18 PM
If .xlsx is a zip archive, why does zipping it reduce file size? Welsh Wizard Excel Discussion (Misc queries) 5 August 13th 09 04:19 PM
How to change default Open/Files of Type to "Microsoft Excel Files Tammy Excel Discussion (Misc queries) 2 January 14th 08 11:06 PM
Zipping my Excel Files and maintain the folder structure Sabine Excel Discussion (Misc queries) 2 August 10th 07 06:02 PM
How can I reduce the size of my Excel file without zipping it? Sizerd Excel Discussion (Misc queries) 1 February 13th 06 11:58 AM


All times are GMT +1. The time now is 11:05 AM.

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"