View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default BuiltInDocumentProperties

Sub GetProps()
On Error Resume Next
MsgBox ActiveWorkbook.BuiltinDocumentProperties.Item("Aut hor")
if err.Number < 0 then
msgbox "Author Not Available"
err.clear
end if
MsgBox ActiveWorkbook.BuiltinDocumentProperties.Item("Las t Save Time")
if err.Number < 0 then
msgbox "Last Save Time not Available"
err.clear
end if
On Error goto 0
End Sub

--
Regards,
Tom Ogilvy

"CLR" wrote:

Hi All........
I am trying to use this code but on some files I get a VB error on the "Last
Save Time" line........how may I cause a return of "Not available" instead of
the VB error?

Sub GetProps()
MsgBox ActiveWorkbook.BuiltinDocumentProperties.Item("Aut hor")
MsgBox ActiveWorkbook.BuiltinDocumentProperties.Item("Las t Save Time")
End Sub