R raywo686794 Nov 9, 2009 #1 What syntax is correct for use with the SHELL() function to open a filename which contains spaces?
A Alex Dybenko Nov 9, 2009 #2 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
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
J Jack Leach Nov 9, 2009 #3 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)
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)