Automatic Save A multiple times a Backup Copy of A Workbook in Excel 2007
When I activate the option of an Automatic Backup, I need to have multiples Backup of the same File, like a version of the File.
each time that I save the File this put a new Backup of the File, until I reach the magic number (ie.
10)
This is a facility that I need because multiples user aceess the same File and do some Changes that mabe are critical in the process.
Tks.
Keys to the Problem Automatic Save A multiple times a Backup Copy of A Workbook in Excel 2007
Download Error Fixer for Free Now
I do exactly that using the before save event.
Follow these instructions, and you will always have the 10 newest copies saved in a sub folder.
First, create a folder named "Backup Folder" in the folder with your workbook (so that it is a sub folder - and note that the code will only work with one workbook in the master folder unless you modify the code a bit).
Then copy this code into the ThisWorkbook's codemodule:
'****************
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim Files2Keep As Integer
With Application
.DisplayAlerts = False
.EnableEvents = False
Files2Keep = 10
ThisWorkbook.SaveCopyAs ThisWorkbook.Path & "\Backup Folder\" & _
.WorksheetFunction.Substitute(ThisWorkbook.Name, ".xls", "") & _
" BU " & Format(Now(), "yyyy-mm-dd hh-mm-ss") & ".xls"
CleanUpBackups Files2Keep
.DisplayAlerts = True
.EnableEvents = True
End With
End Sub
'******************
Then copy this code into a regular codemodule, and create a reference to Microsoft Scripting Runtime:
Sub CleanUpBackups(Files2Keep As Integer)
'Routine to get rid of older backup files
Dim OldestFile As String
Dim OldestDate As Date
Dim objFSO As Scripting.FileSystemObject
Dim objFolder As Scripting.Folder
Dim intFolderSize As Integer
Dim colFiles As Scripting.Files
Dim objFile As Scripting.File
Dim strFile As String
Dim dtmFileDate As Date
OldestFile = ""
OldestDate = Now
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder(ThisWorkbook.Path & "\Backup Folder\")
intFolderSize = objFolder.Files.Count
While intFolderSize > Files2Keep
Set colFiles = objFolder.Files
For Each objFile In colFiles
strFile = objFile.Path
dtmFileDate = objFile.DateCreated
If dtmFileDate < OldestDate Then
OldestDate = dtmFileDate
OldestFile = strFile
End If
Next
objFSO.DeleteFile (OldestFile)
intFolderSize = objFolder.Files.Count
OldestFile = ""
OldestDate = Now
Wend
End Sub
HTH, Bernie
Running System Update Readiness Command
On running the System Update readiness Command, it will Detect & Replace Incorrect Registry data with the Correct one. Which may ultimately Solve Automatic Save A multiple times a Backup Copy of A Workbook in Excel 2007 in Windows.
- Open CMD as Administrator by Simply Right Clicking on Start button > Command Prompt (Admin).
- Now Type or Copy paste "DISM.exe /Online /Cleanup-image /Scanhealth" and hit Enter,
- Now again Type or Copy paste this "DISM.exe /Online /Cleanup-image /Restorehealth" and hit Enter.
- Close the Command Prompt Window because we are done.
Try and see if you still get the same error Automatic Save A multiple times a Backup Copy of A Workbook in Excel 2007 in your Windows.
Note: You may be prompted to enter your administrator's password when you try to execute certain system tasks!
Recommended Method to Repair the Problem: Automatic Save A multiple times a Backup Copy of A Workbook in Excel 2007:
How to Fix Automatic Save A multiple times a Backup Copy of A Workbook in Excel 2007 with SmartPCFixer?
1. Click the button to download SmartPCFixer . Install it on your system. Run it, and it will scan your computer. The errors will be shown in the scan result.
2. After the scan is done, you can see the errors and problems which need to be repaired.
3. The Repair part is done, the speed of your computer will be much higher than before and the errors have been removed. You can also use other functions in this software. Like dll downloading, junk file cleaning and print spooler error repair.
Related: AMD Radeon HD 7800M Win8 not working [Anwsered],I can access the internet, get on facebook and get to hotmail, but I can't play games on facebook and I can't open or respond to my e-mails,I keep getting this Media Player error when I log on my computer. [Anwsered],[Anwsered] System Hanging on shutdown and restart,Unable to get the Vlookup property of the WorksheetFunction class,Solution to Error: Error: "0x81000032 make sure the C: drive is online and set to NTFS" when trying to backup to external hard drive.
,Troubleshoot:External Hard Drive not listed in Windows 7 backup wizard Error
,I'm always being signed off so annoying Tech Support
,Solution to Problem: Impossible to use Internet Explorer! I keep getting the same error message every time i try to use IE.
,Solution to Problem: Referencing data in another file
,Troubleshoot:Error: "0x81000032 make sure the C: drive is online and set to NTFS" when trying to backup to external hard drive. Error,External Hard Drive not listed in Windows 7 backup wizard Tech Support,Tech Support: I'm always being signed off so annoying,Solution to Problem: Impossible to use Internet Explorer! I keep getting the same error message every time i try to use IE.,Referencing data in Access using Excel [Anwsered],Need Best Way To Present Data [Anwsered],Same question but for windows 7 home edition,sometimes fullscreen won't activate [Solved],Solution to Error: We bought a new computer with windows 7 and it is constantly freezing. How do we fix this?,Solution to Error: Windows 8 update crash (2013-07-22)
Read More: Tech Support: Backup Failed Error Codes 0x80070005 AND 0x8078008A.,Solution to Error: Auto Create Hyperlinks,Troubleshooting:Avg. Disk Queue Length is 2. The disk may be at its maxium transfer capacity due to throughput and disk seeks Error,Back up and restore centre - unable to back up to Iomega external hard drive - getting error code 0x81000008 Tech Support,backup set up screen will not show external USB connected HD networked on 2nd PC Tech Support,application not found error,any problems in a team where one has Windows XP and the other has Windows 7?,Application/Object-Defined Error,An Excel formula question where hours are totalled and cumulating,Anyone know the hardware email?
0 comments:
Post a Comment