MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

Obtaining the date modified property of a file from within Excel VBA

  Asked By: Bamah    Date: Oct 05    Category: MS Office    Views: 1588

I'm trying to put together a quick piece of VBA that runs down a list
of Excel workbooks and for each picks up the time at which it was last
modified. I see there's a lastupdated property but don't understand
how to use it.

Any ideas?



1 Answer Found

Answer #1    Answered By: Beverly Brooks     Answered On: Oct 05

Here is a piece of code that will show you how to use the document
properties. To find the specific one you are looking for, search in the
VBE object model. We write a version number of the model that created a
specific workbook, and then, when importing, check what version the
workbook is, so we can import it correctly.

In terms of going to a specific folder, and then trolling through the
workbooks in the folder, visit the following links:
http://www.vba-programmer.com and
A/203.html and http://www.cpearson.com/excel/topic.htm (look for folder)

LVersion =
Split(ActiveWorkbook.BuiltinDocumentProperties("Subject").value, ".")

On Error GoTo noVersionStamp
LfileFormat = LVersion(0) & LCMVersion(1)
On Error GoTo 0

Select Case LfileFormat
Case Is = 41
If verifySheet(fromWorkbook) Then Call
importSheets_41(fromWorkbook, toWorkbook, selectedFile)