A
avi
Is it possible to let Excel save the .xls file to .bak when opening it?
Preferably with a macro.
(I am using Excel 2003).
Cheers,
Avi
Preferably with a macro.
(I am using Excel 2003).
Cheers,
Avi
Dave Peterson said:You can use an application level event.
This goes in the ThisWorkbook module of your persnlk.xls workbook.
(persnlk.xls is the same as the USA version personal.xls???)
Option Explicit
Public WithEvents xlApp As Application
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Set xlApp = Nothing
End Sub
Private Sub Workbook_Open()
Set xlApp = Excel.Application
End Sub
Private Sub xlApp_WorkbookOpen(ByVal Wb As Workbook)
Dim NewFileName As String
NewFileName = Left(Wb.FullName, InStrRev(Wb.FullName, ".")) & "bak"
Wb.SaveCopyAs Filename:=NewFileName
End Sub
(Instrrev was added in xl2k. If you're using xl97, you'll have to parse the
filename differently.)
And an alternative...
Another option would be to dump autosave and use Jan Karel Pieterse's addin
(works in any version) called AutoSafe (note spelling).
It doesn't overwrite the existing workbook when it saves. It saves to a user
selectable folder. And when it's done, it either deletes these backups (or puts
them in the recycle bin). And the user can always restore the backups from the
recycle bin.
http://www.jkp-ads.com/Download.htm
(look for AutoSafe.zip, not autosafeVBE.zip, for your purposes.)
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.