Copying folders using VB in Excel

  Desert Andy 14:54 27 Nov 04
Locked

I am trying to write code to copy folders to a back up folder, whilst in Excel, to back up my files once a week. Is there any way I can do this.
Thanks - Andy

  pc moron 18:59 27 Nov 04

This procedure will copy all the workbooks in Source to Destination.

Sub BackUpFiles()


Dim fs As Variant


Set fs=CreateObject("Scripting.FileSystemObject")


fs.copyfile "c:\Source\*.xls", "c:\Destination"


End Sub


This procedure will copy all the folders in Source to Destination.


Sub BackUpFolders()


Dim fs As Variant


Set fs=CreateObject("Scripting.FileSystemObject")


fs.copyfolder "c:\Source\*", "c:\BackUpFolder"


End Sub

This thread is now locked and can not be replied to.

The Legend of Zelda Breath of the Wild review: Five hours with Zelda on the Nintendo Switch

1995-2015: How technology has changed the world in 20 years

How the painting-like animated sequences in A Monster Calls were created by Glassworks Barcelona

The 22 best Safari extensions | Best Safari plugins: Improve Apple's Safari web browser with these…