View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default insert the date the file was last modified

Try:
=personal.xlsb!docprops("last save time")

Make sure you use the correct extension for your personal.xl* file. And watch
the order of the words!

"Last Save Time" is not the same as "last time save".



Ted M H wrote:

Hi,

I'm trying to get this UDF to work in my Excel 2002 workbook. I've followed
the instructions closely and sometimes it works. For example, I created a
new workbook, book1, and inserted the UDF module as instructed. It worked.
Then I tried putting the same code into a module in my Personal.xls workbook
so that I can run the UDF from any open workbook. It seems to run OK if I
stay inside the Personal.xls workbook, but not when I try to use it in a new
workbook. I've tried using Insert Function and accessing the UDF from the
user-defined functions and I've tried just keying in the =DocProps("last time
save") and neither works (the function returns either #VALUE or #NAME).

I know I'm copying and pasting correctly because the function works
sometimes.

Any idea what I'm doing wrong?

Ted

"Frank Kabel" wrote:

Hi
a UDF is a user defined function written in VBA (visual Basic for
Applications'). For getting started with this see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"Pringles." schrieb im Newsbeitrag
...
sorry to intrude, but... what exactly is a UDF and how do i make one?

"Frank Kabel" wrote:

Hi
use the following UDF:

Function DocProps(prop As String)
application.volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function

and enter in a cell
=DOCPROPS("last save time")
(format cell as date)

--
Regards
Frank Kabel
Frankfurt, Germany

"Ranrunr" schrieb im

Newsbeitrag
...
How do I automatically insert the date the current file was last
modified
into a cell in Excel?





--

Dave Peterson