Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old January 6th 21, 06:08 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Oct 2018
Posts: 8
Default Path string has spaces

This code does NOT work for me:

v = Shell("C:\bin\wordpad.exe c:\files\Jan 2021\dat\readme.rtf")

The error message says "Unable to open c:\files\Jan"

I guess the space character after "Jan" is what causes the problem. Does anyone have any suggestions on how to fix this without renaming the folders?


  #2   Report Post  
Old January 6th 21, 10:37 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2019
Posts: 79
Default Path string has spaces

"Tatsujin" wrote in message
This code does NOT work for me:

v = Shell("C:\bin\wordpad.exe c:\files\Jan 2021\dat\readme.rtf")

The error message says "Unable to open c:\files\Jan"

I guess the space character after "Jan" is what causes the problem. Does
anyone have any suggestions on how to fix this without renaming the
folders?


Try surrounding the path with double quotes -

v = Shell("C:\bin\wordpad.exe ""c:\files\Jan 2021\dat\readme.rtf""")

Peter T


  #3   Report Post  
Old January 7th 21, 08:51 AM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Oct 2018
Posts: 8
Default Path string has spaces

On Wednesday, January 6, 2021 at 2:37:47 AM UTC-7, Peter T wrote:

Try surrounding the path with double quotes -
v = Shell("C:\bin\wordpad.exe ""c:\files\Jan 2021\dat\readme.rtf""")
Peter T


Yes, that worked. Thanks you!


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
Find String in another string - only between spaces Nir Excel Worksheet Functions 9 November 2nd 06 12:31 PM
Value between two spaces in a String [email protected] Excel Programming 5 September 29th 06 06:52 PM
Removing Spaces from string katmando Excel Worksheet Functions 4 May 16th 06 02:16 PM
Open File with Spaces in Path J Excel Programming 5 November 2nd 04 03:52 PM
counting spaces in a string xnman Excel Programming 4 December 16th 03 02:36 AM


All times are GMT +1. The time now is 07:55 AM.

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

About Us

"It's about Microsoft Excel"

 

Copyright © 2017