How to find the owner of the active excel workbook

  • Thread starter Thread starter Janet Panighetti
  • Start date Start date
J

Janet Panighetti

Dear Smart People,

I'm sure this has been asked before but I'm not able to find the answer.

In Visual Basic, how may I find the name or system ID of the owner of the
currently active workbook?

I apologize if this is an "old" question but I've not been able to gleen the
answer.

Thank you!

Janet
 
Take a look at the BuiltInDocumentProperties to see if you can find what you
want there. I'm not sure you can get the "Owner", but you can find who last
modified the document.
 
Take a look at the BuiltInDocumentProperties to see if you can find what you
want there. I'm not sure you can get the "Owner", but you can find who last
modified the document.
 
Maybe "Author" from Properties?

Sub test()
MsgBox ActiveWorkbook.BuiltinDocumentProperties("Author")
End Sub


Gord Dibben MS Excel MVP
 
This macro (GetWorkbookProperties) will give you a message box with the
Workbook properties.
--
Hope this helps.
If it does, please click the Yes button.
Thanks in advance for your feedback.
Gary Brown

'/=======================================/
' Sub Purpose: List Workbook Properties to Msgbox
' both Built-in and Custom
' 01/24/2000
'/=======================================/
'
Sub GetWorkbookProperties()
Dim objProperty As Object
Dim strAnswer As String

On Error Resume Next

'List Workbook name and size
strAnswer = "Workbook: " & _
" " & Excel.ActiveWorkbook.name & vbCr & _
Excel.ActiveWorkbook.FullName & vbCr & _
" - Workbook File Size: " & _
Format(FileLen(Excel.ActiveWorkbook.FullName) / 1024, _
"#,##0") & " kb" & vbCr

'List Builtin Document Properties
For Each objProperty In _
ActiveWorkbook.BuiltinDocumentProperties
With objProperty
strAnswer = strAnswer & vbCr & _
"Builtin - " & .name & " : " & .value
End With
Next

'List Custom Document Properties
For Each objProperty In _
ActiveWorkbook.CustomDocumentProperties
With objProperty
strAnswer = strAnswer & vbCr & _
"Custom - " & .name & " : " & .value
End With
Next

MsgBox strAnswer

exit_Sub:
On Error Resume Next
Exit Sub

err_Sub:
Debug.Print "Error: " & Err.Number & " - (" & _
Err.Description & _
") - " & Now()
GoTo exit_Sub

End Sub
'/=======================================/
 
Back
Top