>Thanks Biff - but my fault.
>I think I asked the wrong question. I want EVERY file I create and save in
[quoted text clipped - 15 lines]
>>> Thanks,
>>> Ron Patterson
Thanks Gord - this was what I was trying to remember.
The only problem seems to be that if I create a new workbook and save it,
there is not a backup created. But if I save it and then click save again
there is a backup created. Any way to avoid having to remember to save it
twice to create a backup.
Thanks,
Ron
> To create a workbook and a worksheet template
>
[quoted text clipped - 57 lines]
>>>> Thanks,
>>>> Ron Patterson
T. Valko - 13 May 2008 22:21 GMT
The backup file (*.xlk) is always one version behind the current file
(*.xls).
When you open a brand new workbook it doesn't exist until you actually save
it. So, until you actually save the file for the first time and it already
exists there is nothing to backup.
I understand what you want to do but I'm not sure how to go about doing it.
It will require some kind of VBA code but it will have to be written such
that you just don't end up with an exact copy of the current file. That's
not the purpose of having a backup.
Gord's much better with VBA than I am. Maybe he has an idea.
If you go about things the way they are, the next time you save the current
file then you'll get the backup which will be one version behind the current
file.

Signature
Biff
Microsoft Excel MVP
> Thanks Gord - this was what I was trying to remember.
> The only problem seems to be that if I create a new workbook and save it,
[quoted text clipped - 65 lines]
>>>>> Thanks,
>>>>> Ron Patterson
Ron Patterson - 13 May 2008 23:25 GMT
Understood now - sure makes sense the way you explained it.
Thanks Biff.
Ron
> The backup file (*.xlk) is always one version behind the current file
> (*.xls).
[quoted text clipped - 84 lines]
>>>>>> Thanks,
>>>>>> Ron Patterson
Gord Dibben - 13 May 2008 23:32 GMT
Biff has hit the nail on the head about having to save twice in order to have a
backup one version earlier than current.
This code will ensure that you save twice with the backup created when you click
"Yes" on the "do you want to overwrite".
The code will not run on subsequent openings of the created file because it will
then have a path.
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Application.DisplayAlerts = False
If ThisWorkbook.Path = "" Then
ThisWorkbook.SaveAs Filename:=ActiveWorkbook.Name
End If
Application.DisplayAlerts = True
End Sub
Of course it means you will get the "enable macros" warning.
Place the code in Thisworkbook module of the Book.xlt
Hopefully someone can come up with something better.
Gord
>Thanks Gord - this was what I was trying to remember.
>The only problem seems to be that if I create a new workbook and save it,
[quoted text clipped - 65 lines]
>>>>> Thanks,
>>>>> Ron Patterson
Ron Patterson - 14 May 2008 02:17 GMT
Well Gord, I am sure your code will work. I just have no idea how or where
to write it - or better - where to put it. All this stuff that is
second nature to you, is beyond my nascent computing skills.
However, testing has just shown me that if I create a new workbook and Save
it and then click on Save again before closing - I get an exact copy. And
every time I edit that file - if I can remember to click Save twice - it
will save the current copy.
This is probably easier for a stunted intellect.
Thanks to both of you for your kind assistance.
Ron
> Biff has hit the nail on the head about having to save twice in order to
> have a
[quoted text clipped - 102 lines]
>>>>>> Thanks,
>>>>>> Ron Patterson
Gord Dibben - 14 May 2008 03:50 GMT
Ron
The code I posted will be placed in Thisworkbook module of the original Book.xlt
Open that original by right-click on it and "Open". That's the way you get the
original, not a copy, opened for edting.
With Book.xlt open right-click on the Excel icon left of "File" on menu.
Select View Code and copy/paste the code into that module.
Alt + q to return to Excel window.
Save the Book.xlt and close it out.
Now hit File>New and Book1 will open with a macro warning.
Enable macros.
Make a few changes to Book1 then save or save as.
One version will be saved immediately and you will be asked if you want to
overwrite that version.
Click yes and it re-saves with a backup named "backup of filename.xlk"
Gord
>Well Gord, I am sure your code will work. I just have no idea how or where
>to write it - or better - where to put it. All this stuff that is
[quoted text clipped - 117 lines]
>>>>>>> Thanks,
>>>>>>> Ron Patterson