View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
mabond mabond is offline
external usenet poster
 
Posts: 14
Default Shell function problem (MS Access)

Rick

thanks, worked a treat...that was one combination I didn't try! Appreciate
the help and spead of response.

Regards

Michael Bond

"Rick Rothstein (MVP - VB)" wrote:

Trying to do this within Excel VBA but having a problem with the following
shell command. The command line switch can't open the named file.

Dim retVal
retVal = Shell("C:\Program Files\Microsoft Office\Office\MSACCESS.EXE
S:\My
Folder\MyFile.mdb", 1)

The problem stems, I assume, from the space in the pathname (something
over
which I have no control)


Give this a try...

retVal = Shell("""C:\Program Files\Microsoft Office\Office\MSACCESS.EXE""
""S:\My Folder\MyFile.mdb""", 1)

Rick