buvanamali
New Member
- Joined
- Jul 27, 2014
- Messages
- 42
Dear Experts
With the following code, I am able to change a single *.jpg file to non English Name and the following code works fine. But my requirement is to rename multiple files.
Also the renamed file doesn't bear the file extn *.jpg.
The above code was found in your forum only.
p.s. Cross posted here: Excel Image Viewer and Rename its File Name
Please help me.
With the following code, I am able to change a single *.jpg file to non English Name and the following code works fine. But my requirement is to rename multiple files.
Also the renamed file doesn't bear the file extn *.jpg.
VBA Code:
Sub ChangeFileName(sFile, tFile)
On Local Error GoTo errors
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
fs.Movefile sFile, tFile
Set f = Nothing
Exit Sub
errors:
MsgBox "File: " & sFile & vbCrLf & Err.Description
Err.Clear
End Sub
Sub test()
Const sDir = "C:\temp\"
ChangeFileName sDir & Range("A1").Value, sDir & Range("B1").Value
End Sub
The above code was found in your forum only.
p.s. Cross posted here: Excel Image Viewer and Rename its File Name
Please help me.