![]() |
BuiltInDocumentProperties
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 |
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 |
BuiltInDocumentProperties
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 |
BuiltInDocumentProperties
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 |
BuiltInDocumentProperties
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 |
BuiltInDocumentProperties
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 |
BuiltInDocumentProperties
Heh-heh...........I helped design and install the first "Automatic telephone
dialer" in that building back about 1965 along with one in "the mountain" in Maryland...... We also got our "snipers" to watch out for down here, but we call them 'gators and sharks. Gotta head out for Doc. appt. now........thanks again much for the help, I did check Chip's site and the rest of what I need appears to be there. Vaya con Dios, Chuck, CABGx3 "Tom Ogilvy" wrote: 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 |
BuiltInDocumentProperties
I expect where I live was a Farm in 1965.
Enjoy the Doc Appt. -- Regards, Tom Ogilvy "CLR" wrote: Heh-heh...........I helped design and install the first "Automatic telephone dialer" in that building back about 1965 along with one in "the mountain" in Maryland...... We also got our "snipers" to watch out for down here, but we call them 'gators and sharks. Gotta head out for Doc. appt. now........thanks again much for the help, I did check Chip's site and the rest of what I need appears to be there. Vaya con Dios, Chuck, CABGx3 "Tom Ogilvy" wrote: 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 |
All times are GMT +1. The time now is 08:13 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com