VBA Workbook Attributes/Properties

bkjohn2016

New Member
Joined
Sep 9, 2016
Messages
38
Hello all,

So, I'm trying to gather several properties for a number of workbooks in a folder:


  • Original Author
  • Creation Date
  • File Size
  • File Type

i have been using the .BuiltinDocumentProperties property to gather the author and creation date but I'm having difficulty getting the last two attributes. File Size is pretty self-explanatory and with file type I'd like to demonstrate if the file is an old 97-2003 file type vs a newer version of excel. Any ideas?

Code:
Sub PrintDocumentProperties()

    For Each p In ActiveWorkbook.BuiltinDocumentProperties
     Debug.Print p
    Next
     
End Sub

Right now I'm still testing but I will want to this print to another worksheet. But all I need are those two last attributes.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
try

Code:
MsgBox CreateObject("scripting.filesystemobject").getfile(ActiveWorkbook.FullName).Type
MsgBox Round(CreateObject("scripting.filesystemobject").getfile(ActiveWorkbook.FullName).Size / 1024, 0) & "KB"
MsgBox ActiveWorkbook.BuiltinDocumentProperties("Author")
MsgBox Format(ActiveWorkbook.BuiltinDocumentProperties("creation date"), "dd mm yyyy")
 
Upvote 0

Forum statistics

Threads
1,223,950
Messages
6,175,582
Members
452,653
Latest member
craigje92

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top