Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Proper Syntax for Date Modified?
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Proper Syntax for Date Modified?
UTIL.Cells(2, 2) = wb.BuiltInDocumentProperties("Last Save time").Value
UTIL.Cells(2, 2).NumberFormat = "mm/dd/yyyy" -- Regards, Tom Ogilvy "Marty" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Proper syntax for this | Excel Discussion (Misc queries) | |||
proper syntax order | Excel Worksheet Functions | |||
Proper Syntax Sought For NewBie Excel Programmer | Excel Programming | |||
proper syntax in code needed | Excel Programming | |||
Proper syntax to Set a Workbook Object? | Excel Programming |