Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() As always Tom, your stuff "works fine, last's a long time".........thank you most kindly. BTW, why is it that some files have the "Last Save Time" and others don't, thereby causing the error...........can the condition be forced somehow? Vaya con Dios, Chuck, CABGx3 "Tom Ogilvy" wrote: 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
xl97 (and earlier I would assume), did not update this property. To the best
of my knowledge, later versions do update it. Interestingly you could use a file in xl2000 or later, then use it in xl97 and the time would not be updated in xl97, but would remain with the time last used in xl2000 or later, so in a mixed environment you could have the error or you could get the wrong time. If you want to force it, in the workbook beforesave event, you could update it with code. Chip Pearson may talk about this on his page (at least he used to). http://www.cpearson.com/excel/docprop.htm -- Regards, Tom Ogilvy "CLR" wrote: As always Tom, your stuff "works fine, last's a long time".........thank you most kindly. BTW, why is it that some files have the "Last Save Time" and others don't, thereby causing the error...........can the condition be forced somehow? Vaya con Dios, Chuck, CABGx3 "Tom Ogilvy" wrote: 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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tom.........I see what you are saying to be fact. I have both XP and
'97 on this machine as this company is 90% '97, so most of my stuff must run on those machines. I'll check out Chips site for forcing the condition, thanks for that. BTW, I see that you're in Northern Virginia....a long time ago I used to work for Atlantic Research Corp at Shirley Highway and Edsall Road in Alexandria/Springfield. Now located in St. Petersburg, Florida, dodging Hurricanes instead of shoveling driveways. Vaya con Dios, Chuck, CABGx3 "Tom Ogilvy" wrote: xl97 (and earlier I would assume), did not update this property. To the best of my knowledge, later versions do update it. Interestingly you could use a file in xl2000 or later, then use it in xl97 and the time would not be updated in xl97, but would remain with the time last used in xl2000 or later, so in a mixed environment you could have the error or you could get the wrong time. If you want to force it, in the workbook beforesave event, you could update it with code. Chip Pearson may talk about this on his page (at least he used to). http://www.cpearson.com/excel/docprop.htm -- Regards, Tom Ogilvy "CLR" wrote: As always Tom, your stuff "works fine, last's a long time".........thank you most kindly. BTW, why is it that some files have the "Last Save Time" and others don't, thereby causing the error...........can the condition be forced somehow? Vaya con Dios, Chuck, CABGx3 "Tom Ogilvy" wrote: 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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Yes, that isn't too far from me - I am out near George Mason University and I
work in the building with 17 Miles of corridors - so I am familiar with that area - used to drive through there when going to Cameron Station when it still existed. I suspect that most of the time, the weather is better in St Petersburg (but not much snow here lately) - and occasionally, we have to duck snipers and airplanes. <g -- Regards, Tom Ogilvy "CLR" wrote: Thanks Tom.........I see what you are saying to be fact. I have both XP and '97 on this machine as this company is 90% '97, so most of my stuff must run on those machines. I'll check out Chips site for forcing the condition, thanks for that. BTW, I see that you're in Northern Virginia....a long time ago I used to work for Atlantic Research Corp at Shirley Highway and Edsall Road in Alexandria/Springfield. Now located in St. Petersburg, Florida, dodging Hurricanes instead of shoveling driveways. Vaya con Dios, Chuck, CABGx3 "Tom Ogilvy" wrote: xl97 (and earlier I would assume), did not update this property. To the best of my knowledge, later versions do update it. Interestingly you could use a file in xl2000 or later, then use it in xl97 and the time would not be updated in xl97, but would remain with the time last used in xl2000 or later, so in a mixed environment you could have the error or you could get the wrong time. If you want to force it, in the workbook beforesave event, you could update it with code. Chip Pearson may talk about this on his page (at least he used to). http://www.cpearson.com/excel/docprop.htm -- Regards, Tom Ogilvy "CLR" wrote: As always Tom, your stuff "works fine, last's a long time".........thank you most kindly. BTW, why is it that some files have the "Last Save Time" and others don't, thereby causing the error...........can the condition be forced somehow? Vaya con Dios, Chuck, CABGx3 "Tom Ogilvy" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Syntax to address ThisWorkbook.BuiltinDocumentProperties via Access Automation? | Excel Discussion (Misc queries) | |||
BuiltinDocumentProperties | Excel Programming |