LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Save workbook versions

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save multiple versions of a document/excel sheet Tonny Excel Discussion (Misc queries) 1 March 29th 09 04:30 PM
how to save versions of multiple linked excel files? Chris TT Excel Discussion (Misc queries) 1 February 20th 08 01:17 PM
save file speeds very different on differnet Excel versions, areSave features tweakable? Mike Scirocco Excel Programming 1 October 10th 06 02:52 PM
kill old versions of workbook ward376 Excel Programming 1 April 15th 06 12:41 AM
Save As csv file between Excel versions EdwardH Excel Programming 2 April 25th 05 05:38 PM


All times are GMT +1. The time now is 02:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"