Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / March 2005

Tip: Looking for answers? Try searching our database.

shell function trouble

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
rocco - 18 Mar 2005 00:43 GMT
Hello,
does anyone know why this code wont' work?
Dim zipped As Long
zipped = Shell(CurrentProject.Path & "\7z\7z.exe a -tzip " & "doubts.zip" &
CurrentProject.Path & "\doubts.doc")

I'm trying to zip through the shell function a file (doubt.doc) which is in
the same folder of my database.

The code run, and I can see that the function give me a task Id different
than zero...but... I dont' see any zipped file. I'm going a bit crazy...
Rocco
Douglas J. Steele - 18 Mar 2005 00:51 GMT
Do you perhaps need a space between doubts.zip and the address to
doubts.doc? Try changing "doubts.zip" to "doubts.zip "

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

> Hello,
> does anyone know why this code wont' work?
[quoted text clipped - 10 lines]
> than zero...but... I dont' see any zipped file. I'm going a bit crazy...
> Rocco
rocco - 18 Mar 2005 01:27 GMT
I have added the space,
now the code is:
Call Shell(CurrentProject.Path & "\7z\7z.exe a -tzip " & CurrentProject.Path
& "\doubts.zip " & CurrentProject.Path & "\doubts.doc", vbNormalFocus)
..and still don't work.
I don't receive any error messages. But I haven't the zipped file. Nice
thursday evening...

> Do you perhaps need a space between doubts.zip and the address to
> doubts.doc? Try changing "doubts.zip" to "doubts.zip "
[quoted text clipped - 13 lines]
> > than zero...but... I dont' see any zipped file. I'm going a bit crazy...
> > Rocco
Peter Martin - 18 Mar 2005 14:23 GMT
Does your currentproject.path have any spaces in it (like 'Program Files')?  
It's safer in general to surround them with quotes (three I think, or is it
four?)

HTH - Peter  

>  I have added the space,
> now the code is:
[quoted text clipped - 21 lines]
> > > than zero...but... I dont' see any zipped file. I'm going a bit crazy...
> > > Rocco
rocco - 18 Mar 2005 14:37 GMT
Yes it has.

it is C:\Documents and Settings\rocco n forgione\My Documents\CLIENTS\GRANT

I have tried to manage this issue in this way:

Dim location As String
location = CurrentProject.Path
Call Shell(location & "\7z\7z.exe a -tzip " & location & "\bamba.zip " &
location & "\doubts.doc")

Still nothing happens...

> Does your currentproject.path have any spaces in it (like 'Program Files')?  
> It's safer in general to surround them with quotes (three I think, or is it
[quoted text clipped - 27 lines]
> > > > than zero...but... I dont' see any zipped file. I'm going a bit crazy...
> > > > Rocco
rocco - 18 Mar 2005 16:28 GMT
To any to may interest: now it works!!
The correct line is:
Call Shell("C:\Program Files\7-Zip\7z a -tzip" & " " & """" &
CurrentProject.Path & "\backup.zip""" & " " & """" & CurrentProject.Path &
"\backup\*""")
(if using 7z like compressing program)

Have to thanks Douglas and Peter for the helpful hints.
Rocco

> Yes it has.
>
[quoted text clipped - 40 lines]
> > > > > than zero...but... I dont' see any zipped file. I'm going a bit crazy...
> > > > > Rocco
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.