Thread: Autoback up
View Single Post
  #1   Report Post  
Greg B
 
Posts: n/a
Default Autoback up

I have excel back up my file throught the code which I got from this forum.
Just one problem with it is I have it run every couple of hours so I dont
lose the work I have completed and it work perfectly except it wont open
because I have personal.xls already open. It continues fine once I click
the read-only tab. I am using the task manager to fire up the workbook at
certain times so it loads another version of excel.

Can i get this macro to run at a certain time if I put it in the
personal.xls

here is the code

Dim oFSO As Object
Dim sFolder As String
Application.DisplayAlerts = False

Set oFSO = CreateObject("Scripting.FileSystemObject")
sFolder = "I:\"
If Not oFSO.FolderExists(sFolder) Then
MkDir sFolder
End If
If Not oFSO.FolderExists(sFolder & Format(Date, "yyyy-mm-dd")) Then
MkDir sFolder & Format(Date, "yyyy-mm-dd")
End If
oFSO.CopyFolder "C:\IDSC", sFolder & Format(Date, "yyyy-mm-dd")
Set oFSO = Nothing
Application.DisplayAlerts = True
ActiveWorkbook.Close

Any help would be great

Thanks again

Greg