ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Path string has spaces (https://www.excelbanter.com/excel-programming/455024-path-string-has-spaces.html)

Tatsujin

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?


Peter T[_8_]

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



Tatsujin

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!


All times are GMT +1. The time now is 12:32 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com