![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Guest
Posts: n/a
|
How to use Macro to rename files and folders. It can not be recorded using Record Macro function.
|
|
|
|
#2 |
|
Guest
Posts: n/a
|
My Office does not have the VBA help files. So i can not find these commands through help file. How can i install the VBA help files? I am using Office 2000, OS Win2000.
|
|
|
|
#3 |
|
Guest
Posts: n/a
|
I have tried Copy "old file name","new file name".
Also Rename "old name","new name". No such things in VBA at all. |
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Location: Calgary Canada
Posts: 222
|
use "Name" Statement for to rename or move a file.
try this: Sub Rename_File() Old_Name_Location = "C:testtest.txt" New_Name_Location = "D:t.txt" Name Old_Name_Location As New_Name_Location ' move and rename file End Sub |
|
|
|
|
|
#5 |
|
Guest
Posts: n/a
|
Dim fs, fsFile, strName As String
Set fs = CreateObject("Scripting.FileSystemObject") Set fsFile = fs.GetFile("filepathandnamewithextension") fsFile.Name = "newfilenamewithextension" |
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|