Spaces not excepted in Shell Command

simmons84

New Member
Joined
Nov 21, 2011
Messages
35
I am using the Shell command to open Wordpad and then an .RTF file. It appears Shell commands don't like spaces in the file path. I know you have to use """" to get around it, but can someone show me how?

Code:
Call Shell("C:\Program Files\Windows NT\Accessories\Wordpad.exe N:\Documents\Files\My Grinders\Grinder 1 Dress\1234.rtf", 1)

It won't recognize anything past "My" on My Grinders. I suppose the same thing would happen for Grinder 1 Dress.

Any suggestions? Thanks
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Try

Call Shell("C:\Program Files\Windows NT\Accessories\Wordpad.exe " & """N:\Documents\Files\My Grinders\Grinder 1 Dress\1234.rtf""", 1)

note the space after exe
 
Upvote 0
This thread has been moved to the General Excel Discussion forum as it is not Excel-related.

Denis
 
Upvote 0

Forum statistics

Threads
1,225,616
Messages
6,186,016
Members
453,334
Latest member
Prakash Jha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top