tags:

views:

67

answers:

1

Help! I'm getting a File Not Found error when trying to rename a file w/a variable. The variable is string. I can look at the variable and it's the exact filename that is there, but when I run the code, it says not found!

Dim filePath, fileName, absPath, newPath As String
filePath = "P:\Automated\"
fileName = MySite.GetResult
absPath = filePath & fileName
newPath = "P:\Automated\NEW.csv"

'The following is a rename from CuteFTP Pro COM Object:
'(Getting the same result from this and the below "Name".
'MySite.LocalRename "P:\Automated\" & fileName, "P:\Automated\NEW.csv"

Name absPath As newPath
A: 

I don't know anything about VBA, but normal languages require a '\' to be escaped. So try "P:\\Automated\\" etc.

Jens
"normal"? Delphi is pretty normal. You probably mean "many languages", or "some languages"?
Andreas Rejbrand
This is not the case with VBA, which is still moderately normal.
Remou