Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm having a little difficulty getting these methods to work. I am
not sure if they are behaving as intended or if I have done somethign incorrectly. To clarify what I am trying to accomplish: I am trying to run a macro on command (i'll make a button for it on the toolbar), I want it to save the current document as a new document with a incremented version number, save date, and user initials. Example: Document 1 <run macro on Aug 6 results in creating: Document 1 -- Ver 01; 2007-08-06 (JQ) <run macro again on Aug 7 results in creating: Document 1 -- Ver 02; 2007-08-07 (JQ) Ideally, version information would be stored in a separate text file so that if previous versions are moved or deleted the version number continues to function as appropriate. This is essentially an adaption of http://www.gmayor.com/save_numbered_versions.htm for word documents, i just can't figure out how to make it work for Excel. Any additional thoughts? Thanks in advance Josh On Jul 26, 5:21 pm, "Bob Phillips" wrote: Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Dim mpFile As String Dim mpVersion As Long On Error Resume Next mpVersion = Evaluate(ThisWorkbook.Names("__Version").RefersTo) On Error GoTo 0 mpVersion = mpVersion + 1 Application.EnableEvents = False Cancel = True mpFile = "My File - " & Application.UserName & _ Application.Text(Date, " yyyymmdd ") & _ "v" & mpVersion ThisWorkbook.SaveAs mpFile ThisWorkbook.Names.Add Name:="__Version", RefersTo:=mpVersion Application.EnableEvents = True End Sub -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) wrote in message oups.com... Does anyone know a macro which saves workbook versions with an incrementing version number, a date, and user initials. Any code, resources, web sites, etc. would be helpful. I would like to also save version information in a text file. thank you. Josh- Hide quoted text - - Show quoted text - |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Save multiple versions of a document/excel sheet | Excel Discussion (Misc queries) | |||
how to save versions of multiple linked excel files? | Excel Discussion (Misc queries) | |||
save file speeds very different on differnet Excel versions, areSave features tweakable? | Excel Programming | |||
kill old versions of workbook | Excel Programming | |||
Save As csv file between Excel versions | Excel Programming |