Excel document propeties in Cells

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any way of showing Excel document properties in cells?

For example, I´d like to show the Title property in a cell.

Thanks.

Carlos.
 
Hi

Maybe UDF like this will do:

Public Function ShowPropertie(strProp As String)
Select Case strProp
Case "Author"
WBProp = ThisWorkbook.Author
Case "FileFormat"
WBProp = ThisWorkbook.FileFormat
Case "FullName"
WBProp = ThisWorkbook.FullName
Case "Name"
WBProp = ThisWorkbook.Name
Case "Path"
WBProp = ThisWorkbook.Path
Case "ReadOnly"
WBProp = ThisWorkbook.ReadOnly
Case "RevisionNumber"
WBProp = ThisWorkbook.RevisionNumber
Case "Title"
WBProp = ThisWorkbook.Title
Case "ActivePrinter"
WBProp = Application.ActivePrinter
Case "Calculation"
WBProp = Application.Calculation
Case "OrganizationName"
WBProp = Application.OrganizationName
Case "UserName"
WBProp = Application.UserName
End Select
End Function


Copy the UDF into your workbook module, and into any cell enter the formula
like
=WBPROP("UserName")
 
For a simple listing of the properties try following code. You find the
according numbers to any property in the HELP.

Sub ReadWorkbookProperties()
Cells(1, 1).Value = ActiveWorkbook.Name
For i = 1 To 30
On Error Resume Next
Cells(i + 1, 1).Value = ActiveWorkbook.BuiltinDocumentProperties(i)
Next
End Sub

Regards
reklamo
 
Back
Top