Rename a .dat file

D

DavidES

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
 
K

Ken Snell \(MVP\)

It's much simpler:

Name "C:\myfolder\weborders.dat" As "C:\myfolder\weborders.csv"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top