Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

remove space from File name 1

Status
Not open for further replies.

vickspills

Programmer
Oct 17, 2018
3
BE
I have a vb script and its failing because of a space in file name(abc xy.xlsx). I tried opeion ch(43) and """" options but not working.
Can somebody help me with this ?
 
You can add double quote to the filename with this function :

Code:
FileNameWithSpace = "abc xy.xlsx"
wscript.echo DblQuote(FileNameWithSpace)
'--------------------------------------
Function DblQuote(Str)
    DblQuote = Chr(34) & Str & Chr(34)
End Function
'--------------------------------------
 
never dreamed of a DblQuote Function, like it, it would have saved me years of typing Chr(34)'s ;-)

I Hear, I Forget
I See, I Remember
I Do, I Understand

Ronald McDonald
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top