Filenames with spaces

  • Thread starter Thread starter raywo686794
  • Start date Start date
R

raywo686794

What syntax is correct for use with the SHELL() function to open a filename
which contains spaces?
 
Hi,
you need to add double quotes, like this:
?shell("C:\Program Files (x86)\Office2003\OFFICE11\MSACCESS.EXE " & """" &
"C:\Program Files (x86)\Microsoft Visual
Studio\MSDN98\98VSa\1033\Samples\VB98\misc\booksale\BOOKSALE.MDB" & """")


--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com
 
Wrap them in quotes as you would a variable...

C:\Documents and Settings\SomeDoc.doc

Shell """C:\Documents and Settings\SomeDoc.doc"""



that's one set of double quotes on the inside, so vba reads it as:

"C:\Documents and Settings\SomeDoc.doc"

which is how you would have to refer to this for commandline functions


hth
--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
Back
Top