Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running A Shell Command In VBA
Hi,
I'm trying to run the following shell command in VBA but it is telling me the file is not found. My home directory when I bring up the command prompt manually is C:\Documents and settings\robin.grossman, which I think is the problem. What should I do? Shell Environ$("COMSPEC") & "DEL Z:\Client Services\Operations \PrintedVersion.pdf" |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Running A Shell Command In VBA
First, VBA has its own version to delete/erase.
Kill "z:\client services\operations\printedversion.pdf" But you could try adding a space character in front of the "DEL" string: Shell Environ$("COMSPEC") _ & " DEL Z:\Client Services\Operations\PrintedVersion.pdf" But I bet you'll need to surround the filename with double quotes since it contains spaces: Shell Environ$("COMSPEC") _ & " DEL ""Z:\Client Services\Operations\PrintedVersion.pdf""" (all untested) R Tanner wrote: Hi, I'm trying to run the following shell command in VBA but it is telling me the file is not found. My home directory when I bring up the command prompt manually is C:\Documents and settings\robin.grossman, which I think is the problem. What should I do? Shell Environ$("COMSPEC") & "DEL Z:\Client Services\Operations \PrintedVersion.pdf" -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Running Shell | Excel Discussion (Misc queries) | |||
running commands from hte shell | Excel Programming | |||
shell command running very slow | Excel Programming | |||
Shell Command | Excel Programming | |||
SHELL command | Excel Programming |