Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Last Save Time, Function not updating in cell

Using WinXP Pro and Excel 2007;
I have the following UDF in a code module of a workbook

Function LSDate()
LSDate = Application.Caller.Parent.Parent. _
BuiltinDocumentProperties("Last Save Time").Value
End Function

Cell A1 =LSDate()
The display date and time in the cell displays correctly when first the
formula is first entered but it does not update unless I re-enter the formula.
Automatic calculation is turned on. I've tried manually recalculating the
worksheet.
I've tried closing and reopening the worksheet.
Any suggestions as to how I can get the cell to update automatically?
Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Last Save Time, Function not updating in cell

You could add a line at the top of the function:

Function LSDate()
Application.Volatile
....


And then your UDF will recalculate whenever excel recalculates. That means that
you still may need to recalc before you believe the value in that cell.



Bassman62 wrote:

Using WinXP Pro and Excel 2007;
I have the following UDF in a code module of a workbook

Function LSDate()
LSDate = Application.Caller.Parent.Parent. _
BuiltinDocumentProperties("Last Save Time").Value
End Function

Cell A1 =LSDate()
The display date and time in the cell displays correctly when first the
formula is first entered but it does not update unless I re-enter the formula.
Automatic calculation is turned on. I've tried manually recalculating the
worksheet.
I've tried closing and reopening the worksheet.
Any suggestions as to how I can get the cell to update automatically?
Thank you.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 117
Default Last Save Time, Function not updating in cell

Thanks Dave!
It works fine now.

"Dave Peterson" wrote:

You could add a line at the top of the function:

Function LSDate()
Application.Volatile
....


And then your UDF will recalculate whenever excel recalculates. That means that
you still may need to recalc before you believe the value in that cell.



Bassman62 wrote:

Using WinXP Pro and Excel 2007;
I have the following UDF in a code module of a workbook

Function LSDate()
LSDate = Application.Caller.Parent.Parent. _
BuiltinDocumentProperties("Last Save Time").Value
End Function

Cell A1 =LSDate()
The display date and time in the cell displays correctly when first the
formula is first entered but it does not update unless I re-enter the formula.
Automatic calculation is turned on. I've tried manually recalculating the
worksheet.
I've tried closing and reopening the worksheet.
Any suggestions as to how I can get the cell to update automatically?
Thank you.


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Last Save Time, Function not updating in cell

Try this

=LSDate()+0*NOW()

Should update when the file opens Might need F9 after saving and keeping
the file open.

Regards,
Peter T

"Bassman62" wrote in message
...
Using WinXP Pro and Excel 2007;
I have the following UDF in a code module of a workbook

Function LSDate()
LSDate = Application.Caller.Parent.Parent. _
BuiltinDocumentProperties("Last Save Time").Value
End Function

Cell A1 =LSDate()
The display date and time in the cell displays correctly when first the
formula is first entered but it does not update unless I re-enter the

formula.
Automatic calculation is turned on. I've tried manually recalculating the
worksheet.
I've tried closing and reopening the worksheet.
Any suggestions as to how I can get the cell to update automatically?
Thank you.



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
Display constanlty updating time in a cell Paul Kraemer Excel Discussion (Misc queries) 2 February 26th 10 02:23 PM
how do i lock a cell? to save formula or function in it? Ajay Upmaneu Excel Discussion (Misc queries) 1 July 4th 06 10:17 AM
Updating a cell that uses a .NET add-in function [email protected] Excel Programming 2 June 7th 06 09:29 PM
Cell showing the time auto updating M. Neves Excel Discussion (Misc queries) 3 February 23rd 06 01:30 PM
How can I disable the save function depending on one cell? Neil Goldwasser[_2_] Excel Programming 4 June 29th 05 06:10 PM


All times are GMT +1. The time now is 08:55 AM.

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

About Us

"It's about Microsoft Excel"