Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: very simple question(What's the renmae command in VBA)

  1. #1
    Guest

    Default

    How to use Macro to rename files and folders. It can not be recorded using Record Macro function.

  2. #2
    Guest

    Default

    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. #3
    Guest

    Default

    I have tried Copy "old file name","new file name".
    Also Rename "old name","new name".
    No such things in VBA at all.
    (((. Please help.

  4. #4
    Board Regular
    Join Date
    Feb 2002
    Location
    Calgary Canada
    Posts
    222
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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. #5
    Guest

    Default

    Dim fs, fsFile, strName As String
    Set fs = CreateObject("Scripting.FileSystemObject")
    Set fsFile = fs.GetFile("filepathandnamewithextension")
    fsFile.Name = "newfilenamewithextension"

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •