View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Joe M. Joe M. is offline
external usenet poster
 
Posts: 97
Default Trouble with UDF - getting #NAME error

I created the following UDF in order to show the last saved date:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
ThisWorkbook.Names.Add Name:="LastSaved", _
RefersToR1C1:="=""" & _
Format(Now, "mmm-dd-yyyy hh:mm") & """"
End Sub

When I enter in a cell =lastsaved or lastsaved() I get the error #NAME. What
am I doing wrong?

Thanks,
Joe M.