Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outputting Last modified / Last Saved Date?

Status
Not open for further replies.

dkmidi

Technical User
Mar 13, 2002
47
CA
Hi,

Is there a way to output the last date that an excel spreadsheet was modified?

Thanks!

DK
 
Hi, dkmidi,

Here's a way to do it...
Code:
For Each x In ActiveWorkbook.BuiltinDocumentProperties
    If x.Name = "Last save time" Then
        MsgBox x.Value
    End If
Next
Hope this helps ;-) Skip,
metzgsk@voughtaircraft.com
 
HI Skip!

Errr... I'm quite the newbie at vb so I'm not exactly understanding the code that you gave me.

If it's not too much trouble could you explain it any simpler? What does x stand for? And also the "Last Save Time".. is that an actual time i need to put in?

Thanks!

DK :)
 
hi, dkmidi,
In Excel there are lots of Collections of Objects. You can read up on these in Help and the Object Browser.

There is a Collection called BuiltinDocumentProperties. Visual Basic for Applications (VBA) has a construct ...
[/code]
For Each object in SomeCollection
'now do stuff with object
Next object
[/code]
In my code, x is an object, a BuiltinDocumentProperty. object. Objects have various properties. One of the properties of BuiltinDocumentProperty is Name and another is Value.

So, what is my little procedure doing?
Its interrogating each BuiltinDocumentProperty in the BuiltinDocumentProperties Collection for the property Name of "Last save time". When Last save time is found, it displays the corresponding Value preperty for Last save time which happens to be...

Last save time !!!!!

VOLA :) Skip,
metzgsk@voughtaircraft.com
 
hi, dkmidi,
In Excel there are lots of Collections of Objects. You can read up on these in Help and the Object Browser.

There is a Collection called BuiltinDocumentProperties. Visual Basic for Applications (VBA) has a construct ...
Code:
For Each
object
Code:
 in SomeCollection
   'now do stuff with
object
Code:
Next object
In my code, x is an object, a BuiltinDocumentProperty. object. Objects have various properties. One of the properties of BuiltinDocumentProperty is Name and another is Value.

So, what is my little procedure doing?
Its interrogating each BuiltinDocumentProperty in the BuiltinDocumentProperties Collection for the property Name of "Last save time". When Last save time is found, it displays the corresponding Value preperty for Last save time which happens to be...

Last save time !!!!!

VOLA :) Skip,
metzgsk@voughtaircraft.com
 
Thanks for all your help Skip! I'll probably need more later but for now this will get me started. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top