By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,790 Members | 1,398 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,790 IT Pros & Developers. It's quick & easy.

Spaces and path

P: n/a
UI
Hi,

I am having trouble using the following code:

RetVal = Shell("C:\Program Files\Microsoft Office\Office" & tussen &
"\excel.exe " & thispath, 1)

Don't mind tussen, this is to switch between Office 2000 and 2002
It works fine until there are spaces in the variable thispath. I would like
to be able to use it whether there are spaces in the mapnames or not.
Any ideas?

Thanks in advance

Lx
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a

RetVal = Shell("C:\Program Files\Microsoft Office\Office" & tussen &
"\excel.exe " & """" & thispath & """", 1)
Terry
"UI" <asd@as> wrote in message
news:3f**********************@dreader5.news.xs4all .nl...
Hi,

I am having trouble using the following code:

RetVal = Shell("C:\Program Files\Microsoft Office\Office" & tussen &
"\excel.exe " & thispath, 1)

Don't mind tussen, this is to switch between Office 2000 and 2002
It works fine until there are spaces in the variable thispath. I would like to be able to use it whether there are spaces in the mapnames or not.
Any ideas?

Thanks in advance

Lx

Nov 12 '05 #2

P: n/a
"UI" <asd@as> wrote in message news:<3f**********************@dreader5.news.xs4al l.nl>...
Hi,

I am having trouble using the following code:

RetVal = Shell("C:\Program Files\Microsoft Office\Office" & tussen &
"\excel.exe " & thispath, 1)

Don't mind tussen, this is to switch between Office 2000 and 2002
It works fine until there are spaces in the variable thispath. I would like
to be able to use it whether there are spaces in the mapnames or not.
Any ideas?

Thanks in advance

Lx


Lx,

try this:
RetVal = Shell("""C:\Program Files\Microsoft Office\Office" & tussen &
_
"\excel.exe """ & thispath & """", 1)

by using double-quotes twice within a string surrounded with
double-quotes the resulting expression gets single double-quotes
around the strings. These double-quotes prevent spaces to be
interpreted as separators for parameters in the command-line.

Marc
Nov 12 '05 #3

P: n/a
UI
Thanks Terry, it did the trick!

Lx

"Terry Kreft" <te*********@mps.co.uk> schreef in bericht
news:bk**********@newsreaderg1.core.theplanet.net. ..

RetVal = Shell("C:\Program Files\Microsoft Office\Office" & tussen &
"\excel.exe " & """" & thispath & """", 1)
Terry
"UI" <asd@as> wrote in message
news:3f**********************@dreader5.news.xs4all .nl...
Hi,

I am having trouble using the following code:

RetVal = Shell("C:\Program Files\Microsoft Office\Office" & tussen &
"\excel.exe " & thispath, 1)

Don't mind tussen, this is to switch between Office 2000 and 2002
It works fine until there are spaces in the variable thispath. I would

like
to be able to use it whether there are spaces in the mapnames or not.
Any ideas?

Thanks in advance

Lx


Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.