#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 390
Default Extended System Info

Is there a way for an Excel formula to know the date stamp of
a file?

Thanks,
Dallman
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Extended System Info


'-----------------------------------------------------------------
Function DocProps(prop As String)
'-----------------------------------------------------------------
Application.Volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function


and enter in a cell such as
=DocProps ("last author")
or
=DocProps ("last save time")



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Dallman Ross" <dman@localhost. wrote in message
...
Is there a way for an Excel formula to know the date stamp of
a file?

Thanks,
Dallman



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 390
Default Extended System Info

In , Bob Phillips
spake thusly:

'-----------------------------------------------------------------
Function DocProps(prop As String)
'-----------------------------------------------------------------
Application.Volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function


and enter in a cell such as
=DocProps ("last author")
or
=DocProps ("last save time")


That's very nice! However, I want it to be for a different file,
not the active workbook. E.g.,
"E:\My Documents\Records\Finance\Securities\Statements\20 06\SB 2006 Unrealized Gains, Trading.csv"
(which is also a data source for one of the open worksheets, in case that helps).

--
dman
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 390
Default Extended System Info

In , Dallman Ross <dman@localhost. spake thusly:

Okay, I did find this:
http://www.cpearson.com/excel/docprop.htm

And I downloaded DSO Version 2.0 from Microsoft as indicated on the
page and installed it. But I'm a bit lost as to how to get the
code snippet to work. Is it still a function? I have this
now --

Dim FileName As String
Dim DSO As DSOFile.OleDocumentProperties
Set DSO = New DSOFile.OleDocumentProperties
FileName = "E:\My Documents\Records\Finance\Securities\Statements\20 06\SB 2006 Unrealized Gains, Trading.csv"
DSO.Open sfilename:=FileName
Debug.Print DSO.SummaryProperties.DateCreated
DSO.Close

I'm not sure how to put that into the VBA area, i.e., what to call it,
how to access it, etc. Basically, I'm pretty confused about where
to put the above and how to get the result into a cell in Excel.

Dallman

In , Bob Phillips
spake thusly:

'-----------------------------------------------------------------
Function DocProps(prop As String)
'-----------------------------------------------------------------
Application.Volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function


and enter in a cell such as
=DocProps ("last author")
or
=DocProps ("last save time")


That's very nice! However, I want it to be for a different file,
not the active workbook. E.g.,
"E:\My Documents\Records\Finance\Securities\Statements\20 06\SB 2006 Unrealized Gains, Trading.csv"
(which is also a data source for one of the open worksheets, in case that helps).

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Extended System Info

You need to create a sub, or a function and add it there. These go into a
standard code module, InsertModule in the VBIDE.

Whether it is a sub or a function depends upon how you want to get the
results.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Dallman Ross" <dman@localhost. wrote in message
...
In , Dallman Ross <dman@localhost. spake

thusly:

Okay, I did find this:
http://www.cpearson.com/excel/docprop.htm

And I downloaded DSO Version 2.0 from Microsoft as indicated on the
page and installed it. But I'm a bit lost as to how to get the
code snippet to work. Is it still a function? I have this
now --

Dim FileName As String
Dim DSO As DSOFile.OleDocumentProperties
Set DSO = New DSOFile.OleDocumentProperties
FileName = "E:\My

Documents\Records\Finance\Securities\Statements\20 06\SB 2006 Unrealized
Gains, Trading.csv"
DSO.Open sfilename:=FileName
Debug.Print DSO.SummaryProperties.DateCreated
DSO.Close

I'm not sure how to put that into the VBA area, i.e., what to call it,
how to access it, etc. Basically, I'm pretty confused about where
to put the above and how to get the result into a cell in Excel.

Dallman

In , Bob Phillips
spake thusly:

'-----------------------------------------------------------------
Function DocProps(prop As String)
'-----------------------------------------------------------------
Application.Volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function


and enter in a cell such as
=DocProps ("last author")
or
=DocProps ("last save time")


That's very nice! However, I want it to be for a different file,
not the active workbook. E.g.,
"E:\My Documents\Records\Finance\Securities\Statements\20 06\SB 2006

Unrealized Gains, Trading.csv"
(which is also a data source for one of the open worksheets, in case

that helps).





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 390
Default Extended System Info

In , Bob Phillips
spake thusly:

You need to create a sub, or a function and add it there. These
go into a standard code module, InsertModule in the VBIDE.

Whether it is a sub or a function depends upon how you want to
get the results.


Bob, I know we're close and I really appreciate the help. I just
don't know much of any VBA stuff and can't get this to work without
a full example. I've tried for quite some time now, including
with various websearch hints, but can't quite make it work.
Can you nudge me just a little bit more in the right direction?

You're putting the quotation of the previous article after your
..sig block, which is making my newsreader disregard that text when
I follow up -- sorry. But of course the prior article references
are all still here right now.

(I'm used to reading news in a Unix world, which I've been
doing for about 16 years now. And try as I might, I cannot
get used to the top-posting in this group. Oh, well. Not
to worry, I also own a fair bit of Microsoft stock.) ;-)
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
How do I get ONLY new info from 1 Worksheet to another automatical Elaine Excel Worksheet Functions 6 July 13th 06 05:45 PM
Concatenating info from several cells into the one above method373 Excel Discussion (Misc queries) 1 February 22nd 06 01:18 AM
Reflecting info between an excel file and a word one or two excel file. Starriol Excel Worksheet Functions 0 November 3rd 05 01:49 PM
Reflecting info between an excel file and a word one or two excel file. Starriol Links and Linking in Excel 0 November 3rd 05 01:49 PM
Reflecting info between an excel file and a word one or two excel file. Starriol Excel Discussion (Misc queries) 0 November 3rd 05 01:49 PM


All times are GMT +1. The time now is 07:14 PM.

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"