#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Shell

I am using the "Shell" comand from Excel to open different files. This works
fine until the path contains a space.

for instance, the following line

Shell "start " & pName & "\test.htm"

WORKS
when pName = "C:\Active\pictures\html\clifton"

FAILS
when pName = "C:\Active\pictures\html\alton on tees"


i.e. when the path contains a space an error is thrown!
Any Suggestions!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Shell

Hi Stuart,

If you surround the file and path name (but not the command) in double
quotes it should work whether or not there are embedded spaces, e.g.:

Shell "start """ & pName & "\test.htm"""

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm

"Stuart" wrote in message
...
I am using the "Shell" comand from Excel to open different files. This
works
fine until the path contains a space.

for instance, the following line

Shell "start " & pName & "\test.htm"

WORKS
when pName = "C:\Active\pictures\html\clifton"

FAILS
when pName = "C:\Active\pictures\html\alton on tees"


i.e. when the path contains a space an error is thrown!
Any Suggestions!




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell Method David Hall[_6_] Excel Programming 1 February 12th 05 08:50 PM
VBE COM Add-in Shell R Avery Excel Programming 1 August 12th 04 02:55 PM
trying to put a check box in each shell with vba rob merritt Excel Programming 3 June 2nd 04 07:06 AM
Shell function John Keturi Excel Programming 1 May 23rd 04 02:09 AM
Shell Joseph[_12_] Excel Programming 1 February 1st 04 04:33 AM


All times are GMT +1. The time now is 09:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"