幫助!嘗試使用變量重命名文件時,出現File Not Found
錯誤。該變量是一個string
。我需要在VBA中重命名一個文件,但是當它清晰時出現「文件未找到」
我可以看看變量,它是那裏的確切文件名,但是當我運行代碼時,它說「找不到」!
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
名稱中是否有空格?你用filesystemobject得到什麼? – Fionnuala 2010-05-26 20:12:11
你有權限嗎?錯誤消息有時不太可靠。 – 2010-05-26 20:12:19