Datetime of Excel-document

D

Dirk Flakowski

Hello,

If I just open any Excel-document then right at that time
Windows-Explorer changes date of the last change of that file to NOW.
Even if I don't modify/save it. If I then close it without saving the
date is again reset to the old one.
How can I find out the real date/time of the last change of an
Excel-document while it is open?

Thanks for your trouble in advance
Dirk
 
J

Jim Rech

You could change the workbook to read-only and check the file time. If
you've made changes though you'll be prompted to save them.

Sub a()
MsgBox FileDateTime("c:\book1.xls")
Workbooks("Book1.xls").ChangeFileAccess xlReadOnly
MsgBox FileDateTime("c:\book1.xls")
Workbooks("Book1.xls").ChangeFileAccess xlReadWrite
End Sub


--
Jim Rech
Excel MVP
| Hello,
|
| If I just open any Excel-document then right at that time
| Windows-Explorer changes date of the last change of that file to NOW.
| Even if I don't modify/save it. If I then close it without saving the
| date is again reset to the old one.
| How can I find out the real date/time of the last change of an
| Excel-document while it is open?
|
| Thanks for your trouble in advance
| Dirk
 
D

Dirk Flakowski

Hello Jim,

thanks for your fast answer. But what can I do if I want to get latest
date/time with VB and the file is opened at the same time by any other
user on the network? Then I have no possibility to set it to ReadOnly.
Do you see any chance to get the real last update?

Thanks
Dirk
 
J

Jim Rech

Do you see any chance to get the real last update?

No I don't. As far as I know there is no way to distinguish between the
"real" date stamp and the temporary one Excel assigns when the workbook is
opened.

--
Jim Rech
Excel MVP

| Hello Jim,
|
| thanks for your fast answer. But what can I do if I want to get latest
| date/time with VB and the file is opened at the same time by any other
| user on the network? Then I have no possibility to set it to ReadOnly.
| Do you see any chance to get the real last update?
|
| Thanks
| Dirk
|
| On Tue, 8 Jun 2004 06:54:35 -0400, "Jim Rech" <[email protected]>
| wrote:
|
| >You could change the workbook to read-only and check the file time. If
| >you've made changes though you'll be prompted to save them.
| >
| >Sub a()
| > MsgBox FileDateTime("c:\book1.xls")
| > Workbooks("Book1.xls").ChangeFileAccess xlReadOnly
| > MsgBox FileDateTime("c:\book1.xls")
| > Workbooks("Book1.xls").ChangeFileAccess xlReadWrite
| >End Sub
| >
| >
| >--
| >Jim Rech
| >Excel MVP
|
 
L

Lady Layla

Only way that could happen is if the document is shared. If it is a shared
document, would track changes suit your purposes?


: Hello Jim,
:
: thanks for your fast answer. But what can I do if I want to get latest
: date/time with VB and the file is opened at the same time by any other
: user on the network? Then I have no possibility to set it to ReadOnly.
: Do you see any chance to get the real last update?
:
: Thanks
: Dirk
:
: On Tue, 8 Jun 2004 06:54:35 -0400, "Jim Rech" <[email protected]>
: wrote:
:
: >You could change the workbook to read-only and check the file time. If
: >you've made changes though you'll be prompted to save them.
: >
: >Sub a()
: > MsgBox FileDateTime("c:\book1.xls")
: > Workbooks("Book1.xls").ChangeFileAccess xlReadOnly
: > MsgBox FileDateTime("c:\book1.xls")
: > Workbooks("Book1.xls").ChangeFileAccess xlReadWrite
: >End Sub
: >
: >
: >--
: >Jim Rech
: >Excel MVP
:
 

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