View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T[_8_] Peter T[_8_] is offline
external usenet poster
 
Posts: 88
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