shell.exe help

M

mg

coding vba in access2007...
- i am using the shell command to open a file chosen by the user in excel
- it works fine until the path or filename contain a space, at which time
excel truncates the filename and places an xlsx extension and tries to open
it (and fails)
- i have experimented with using parenthesis, double and single quotes in
various places, but it keeps failing the the path or filename contains a
space.

any ideas??

x="excel.exe c:\directoryname\filename with a space.xlsx"
shell (x)
 
M

mg

i found it out-----
i had to use the ascii code for the quote
so ---
shell ("excel.exe " & chr(34) & X & chr(34)) 'where X=the string
containing the path\filename with spaces
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top