Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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

  #5   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default 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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax to address ThisWorkbook.BuiltinDocumentProperties via Access Automation? [email protected] Excel Discussion (Misc queries) 0 June 24th 08 01:29 AM
BuiltinDocumentProperties Joop[_2_] Excel Programming 2 August 17th 03 11:28 AM


All times are GMT +1. The time now is 05:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"