Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Runtime Error '53' File Not Found?
Hi,
I have an Excel macro that is supposed to go through all the files in a directory and change the extensions from DOC to DAT. It was working at first, but now it seems that I keep getting the File Not Found error (Runtime Error 53) when I try to run the macro, even though the file to be renamed is explicitly there in the folder. What am I missing here? Thanks in advance! Public Sub ChangeFileExtensions() Dim strDir As String strDir = ThisWorkbook.Path Call ProcessFiles(Dir(strDir & "\*.Doc")) Do ' LOOP THRU ALL D06 IN JUNKFOLDER Loop Until Not ProcessFiles(Dir) End Sub Function ProcessFiles(SourceFile) On Error GoTo NoFiles oldName = SourceFile newName = Left(SourceFile, (Len(SourceFile) - 3)) & "DAT" Name oldName As newName Exit Function NoFiles: ProcessFiles = False End Function |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Retaining formats | Excel Discussion (Misc queries) | |||
file not found when opening the file | Excel Discussion (Misc queries) | |||
File Not Found between two versions | Excel Discussion (Misc queries) | |||
Weird File Open/Save As Behavior | Excel Discussion (Misc queries) | |||
Weekly Transaction Processing | Excel Worksheet Functions |