Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Backing up work folder
Hi all,
Just wondering how I can back up a complete directory folder containing all the .xls files I have. I have setup a macro that save certain file and back them up but I would like to have the complete file copied and saved into H:\backup\with today's date as the folder name. Is there anyway to do this? Thanks Greg |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Backing up work folder
Try:
Private Declare Function MakeSureDirectoryPathExists Lib "imagehlp.dll" (ByVal lpPath As String) As Long Sub xx() targetfolder = "c:\ajay\back\" MakeSureDirectoryPathExists targetfolder Set fso = CreateObject("Scripting.FileSystemObject") For Each file In fso.getfolder("c:\ajay").Files Select Case fso.getfile(file.Path).Type Case "Microsoft Excel Worksheet" fso.getfile(file.Path).Copy targetfolder End Select Next set fso = nothing End Sub "Greg B..." wrote: Hi all, Just wondering how I can back up a complete directory folder containing all the .xls files I have. I have setup a macro that save certain file and back them up but I would like to have the complete file copied and saved into H:\backup\with today's date as the folder name. Is there anyway to do this? Thanks Greg |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
work books only reference sheets in same folder... | Excel Discussion (Misc queries) | |||
backing up | Excel Discussion (Misc queries) | |||
Backing up folder | Excel Discussion (Misc queries) | |||
How can I get my Favorites Folder and get it to work again? | Setting up and Configuration of Excel | |||
Backing Up | Excel Worksheet Functions |