Proper Syntax for Date Modified?

G

Guest

Hi:

I'm using Excel 2003. I have a workbook (utility.xls) which cycles through
all of the open workbooks (except itself) and exracts data.

(This works now thanks to a couple of brilliant replies by Bob and Bernie to
an earlier post.)

Next, I want to put the names of the workbooks I'm extracting from and the
dates they were last modified in some cells in utility.xls. Here is the code:

Private Sub CommandButton1_Click()
Dim UTIL, BOOK As Object
Set UTIL = Workbooks(ActiveWorkbook.Name).Sheets("Sheet1")
For Each wb In Application.Workbooks
Set BOOK = wb.Sheets("Sheet1")
If wb.Name = ActiveWorkbook.Name Then GoTo 100:
MsgBox wb.Name
UTIL.Cells(1, 1) = UTIL.Cells(1, 1) + BOOK.Cells(1,1)
UTIL.Cells(2, 1) = wb.Name
'THIS NEXT LINE IS THE PROBLEM
UTIL.Cells(2, 2) = wb.DateModified
100:
Next wb
End Sub

Any suggestions on how to modify the PROBLEM line in order to make it put in
the date the workbook was last modified?
(The preceeding line where I display the name works fine. I think it's just
a syntax problem: "Object doesn't support this property or method.")

Thanks in advance,
MARTY
 
T

Tom Ogilvy

UTIL.Cells(2, 2) = wb.BuiltInDocumentProperties("Last Save time").Value
UTIL.Cells(2, 2).NumberFormat = "mm/dd/yyyy"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top