Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Is there a way for an Excel formula to know the date stamp of
a file? Thanks, Dallman |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() '----------------------------------------------------------------- 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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I get ONLY new info from 1 Worksheet to another automatical | Excel Worksheet Functions | |||
Concatenating info from several cells into the one above | Excel Discussion (Misc queries) | |||
Reflecting info between an excel file and a word one or two excel file. | Excel Worksheet Functions | |||
Reflecting info between an excel file and a word one or two excel file. | Links and Linking in Excel | |||
Reflecting info between an excel file and a word one or two excel file. | Excel Discussion (Misc queries) |