copying files external to access

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

I'm looking for a way to add a button to a form that when
clicked, copies an Excel file from one folder to another.

Currently I am using the shell function to run a .bat file
which does the copy:

Private Sub Command0_Click()
Shell "O:\dsopsdb\sprs\opsd.bat"
End Sub

Is there a more elegant or efficient way to do this?
 
Tim

Take a look at the VBA FileCopy Function. As long at the Excel File is not
open it will do the deed. If the File is likely to be open when you go to
copy it take a look at the copy file function in FileScripting objects.

Ron W
 
Back
Top