ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Getting NTFS file attributes (https://www.excelbanter.com/excel-discussion-misc-queries/38793-getting-ntfs-file-attributes.html)

Kiran

Getting NTFS file attributes
 
Is it possible to get NTFS file attributes (like Date created, author, size)
to get it using VBA code. If yes, Can you please let me know how I can achive
that

Thnx


Bob Phillips

Kiran,

This isn't getting the NTFS attributes directly, but looking at custom
properties stored with the workbook

First, add this UDF (user defined function) to a standard code module

'-----------------------------------------------------------------
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")

other attributes

Title
Subject
Author
Keywords
Comments
Template
Last Author
Revision Number
Application Name
Last Print Date Creation Date
Last Save Time
Total Editing Time
Number of Pages
Number of Words
Number of Characters
Security
Category
Format
Manager Company
Number of Bytes
Number of Lines
Number of Paragraphs
Number of Slides
Number of Notes
Number of Hidden Slides
Number of Multimedia Clips
Hyperlink Base
Number of Characters (with spaces)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Kiran" wrote in message
...
Is it possible to get NTFS file attributes (like Date created, author,

size)
to get it using VBA code. If yes, Can you please let me know how I can

achive
that

Thnx





All times are GMT +1. The time now is 09:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com