Trouble coping files

  • Thread starter Thread starter dflemings
  • Start date Start date
D

dflemings

Guest
I need to copy and rename a file. This works if I type the path directly but I need to use a string varible, since the path may vary per computer user.

'Copy the import file to xpath and rename to iif file, so file is in the users default directory
'In this case xpath = C:\Windows\
Copystring = "COMMAND.COM /C COPY c:\Access2000\AccessDataImport.TXT " & xpath & "*.IIF"
Call Shell(Copystring, 0)

No error messages, just doesn't copy.
Didn't have any luck with the "COPYMETHOD"

Help!!
 
Hi d,

you should be able to use
FileCopy source, destination from within VBA, no need to shell

HTH

Drew

[This message has been edited by KDg (edited 06-06-2001).]
 

Users who are viewing this thread

Back
Top Bottom