Shell function has a path with embedded blanks

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I use the Shell function to zip a file. The directory path to the input file
contains embedded blanks in the name. I can't change the name. So, how can I
hard code this path? eg H:\"My directory"\ doesn't work. Thanks.
 
Try using Chr(34) in place of your double quotes like this:

strMyPath = "H:\" & Chr(34) & "My directory" & Chr(34) & "\"


Branden Johnson
 
Branden Johnson said:
Try using Chr(34) in place of your double quotes like this:

strMyPath = "H:\" & Chr(34) & "My directory" & Chr(34) & "\"

The quotes should be around the entire path name rather than just the
directory name

Try

strMyPath = """H:\" & "My directory" & "\"""

Tom Lake
 
Back
Top