Rename a .dat file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to rename a .dat file to a .csv file so I can work with it in Access
2003. The following code does not work... any ideas what I should do?


Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Function ChangeFile()
x = Shell("ren C:\myfolder\weborders.dat weborders.csv")
Sleep (8000)

End Function
 
Hi

Just use the Name method:

Function ChangeFile()
Name "C:\myfolder\weborders.dat" As "C:\myfolder\weborders.csv"
End Function

Nor sure why you have the sleep command though!

Cheers.

BW
 
Back
Top