ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy and paste over existing file? (https://www.excelbanter.com/excel-programming/430541-copy-paste-over-existing-file.html)

Cam

Copy and paste over existing file?
 

Hello,

I have several Excel files that I update (refresh) the data on my C:\ drive
(much faster refreshing time). Then, I would have to copy all these files and
paste over the existing files (same file name) in a network drive.

Is there a way in macro to automate this process? I remembered back in the
DOS days, you can create a bat file to perform this function. Thanks

Patrick Molloy

Copy and paste over existing file?
 

in Excel's VBA editor, set a Reference (menu: Tools/References...) to the
Microsoft Scripting Runtime DLL and add this code to a new module

Sub MoveFiles()
Application.DisplayAlerts=False
With New FileSystemObject
.MoveFolder "{source folder}", "{target folder}"
End With
Application.DisplayAlerts=True
End Sub

"Cam" wrote in message
...
Hello,

I have several Excel files that I update (refresh) the data on my C:\
drive
(much faster refreshing time). Then, I would have to copy all these files
and
paste over the existing files (same file name) in a network drive.

Is there a way in macro to automate this process? I remembered back in the
DOS days, you can create a bat file to perform this function. Thanks




All times are GMT +1. The time now is 10:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com