pcsparky
03-11-2011, 02:55 PM
I keep getting error 75 which is Path/File access error if anyone is kind enough to spot what is going wrong for me please. I have checked that the old folder and new folder names are correct. :banghead:
Basically I'm changing filenames within the folder first using this code and after the Loop has finished trying to change the folder name:
myPath = ThisWorkbook.Path & "\Handlers\" & hName
ChDrive myPath
On Error GoTo changeFilename_error
ChDir myPath & "\"
fileName = Dir("*.xlsm")
Do While fileName <> ""
'CODE TO CHANGE FILE NAME AND OTHER STUFF
fileName = Dir()
Loop
newFolder = ThisWorkbook.Path & "\Handlers\" & tmp(1) & " " & tmp(2)
Name myPath as newFolder 'GET ERROR 75 HERE
Basically I'm changing filenames within the folder first using this code and after the Loop has finished trying to change the folder name:
myPath = ThisWorkbook.Path & "\Handlers\" & hName
ChDrive myPath
On Error GoTo changeFilename_error
ChDir myPath & "\"
fileName = Dir("*.xlsm")
Do While fileName <> ""
'CODE TO CHANGE FILE NAME AND OTHER STUFF
fileName = Dir()
Loop
newFolder = ThisWorkbook.Path & "\Handlers\" & tmp(1) & " " & tmp(2)
Name myPath as newFolder 'GET ERROR 75 HERE