Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Proper syntax for this Barb Reinhardt Excel Discussion (Misc queries) 1 August 4th 06 02:15 PM
proper syntax order Roberta H via OfficeKB.com Excel Worksheet Functions 2 January 18th 06 10:14 PM
Proper Syntax Sought For NewBie Excel Programmer Sprinks Excel Programming 6 October 15th 04 02:25 PM
proper syntax in code needed Jim May Excel Programming 2 September 19th 04 12:44 AM
Proper syntax to Set a Workbook Object? Rick Stanford Excel Programming 2 September 13th 03 07:15 PM


All times are GMT +1. The time now is 06:35 PM.

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

About Us

"It's about Microsoft Excel"