#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Excel VBA

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.

Bryan Toma wrote:

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


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"