Excel VBA

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

Guest

Need to copy external .xls file from one server and save to a different
server without opening file. Macro would go to Windows Explorer and
copy/save files without opening file. Possible?

Thanks,
Bryan
 
You can use the FileCopy inside an excel macro:

Option Explicit
Sub testme01()

FileCopy Source:="\\server01\folder01\file01.xls", _
Destination:="\\server02\folder02\file02.xls"

End Sub

But heck, you could use an old DOS command (as a .bat file???) and never even
have to open excel.

make a text file (notepad) that contains lines like:

copy "\\server01\folder01\file01.xls" "\\server02\folder02\file02.xls"

Then save it as MyBackup.Bat

Then just double click on it in explorer to test it out.
 

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

Back
Top