FileDateTime function - how to make it authomatic?

  • Thread starter Thread starter bondcrash
  • Start date Start date
B

bondcrash

Hi all,

Have a shared workbook with three worksheets - I am trying to see in
cell the last of them that has been changed (and saved) so for th
others to catch up, without waiting the minumum 5 mins allowed in th
tabs.

I am using a FileDateTime function to show the last time/date of th
file in the shared directory.

It works fine the first time. However, to see the latest updated valu
I need to go in the cell and retype the function manually (i.e. is no
automatic). Is there a way to go around it?

Many thanks

B
 
What code are you using?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
This is the one I am using


Function last_time()
Dim all_saved As Date

all_saved = FileDateTime("\\Your-1af8a1ea42\SharedDocs\control.xls")
last_time = all_saved

End Function


I have tried also reopening the sheet or recalculating but only way t
update the right time is to go in the cell manually and re-enter it


Cheers

B
 
It won't recalculate automatically, as there is no cell changed when you
save, and the formula doesn't reference anything, so there is nothing to
trigger it.

You could trap the save event and write to the cell.

Or, if you use this code you can force a recalculate with Alt-F9

Function last_time()
Dim all_saved As Date

Application.Volatile
all_saved = FileDateTime(ThisWorkbook.FullName)
last_time = all_saved

End Function



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

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

Back
Top