MetaData

MikeDBMan

Well-known Member
Joined
Nov 10, 2010
Messages
608
I have a lot of .xlsx (or .xlsm) stored on SharePoint sites. We store several pieces of data in the metadata area of the files. I would like to either use a UDF or some kind of method to display some of the metadata in my spreadsheet. I would prefer NOT to have to open the properties window as there are a lot of fields I don't care about. Is this possible to do? Thanks!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Mike, That's a great idea.

Here's a UDF you could try.
Code:
Function GetProperty(sPropertyName As String, _
        Optional bCustom As Boolean = False, _
        Optional bVolatile As Boolean = False) As String
    
    If bVolatile Then Application.Volatile
    
    If bCustom Then
        GetProperty = ThisWorkbook.CustomDocumentProperties(sPropertyName)
    Else
        GetProperty = ThisWorkbook.BuiltinDocumentProperties(sPropertyName)
    End If
End Function

The function takes up to 3 parameters:
sPropertyName: (required) The Property Name
bCustom: (optional) True for Custom Properties, False for Built-In Properties (default)
bVolatile: (optional) True for recalculate with any worksheet calculation, False = recalculate when input parameter changes only (default).

Here's some examples showing how the function might be called:
Excel Workbook
AB
1Built-in Property Examples
2TitleUDF to Show Document Properties
3AuthorJS411
4Keywords:Excel, VBA, UDF, Properties
5Last save time1/6/2012 12:29:55 AM
6
7Custom Property Examples
8Client:Acme Biz
9ProjectTop Secret
10Document Number1234
Sheet
 
Upvote 0
This seems to work. On documents that are .xlsx since I am using a vba program to open and check out the documents, I think I'll just refresh a place in one sheet with the latest version of what the properties are since I can't seem to make a udf work in a non-macro .xlsx file. Thanks for the help!
 
Upvote 0

Forum statistics

Threads
1,215,779
Messages
6,126,850
Members
449,344
Latest member
TFXm

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