Author of a Closed Workbook

davidhall80

Well-known Member
Joined
Jul 8, 2006
Messages
663
I need to get the name of the Author of a closed Workbook. Anyone know how to do this in Excel 2010 and/or Excel 2007? It would also be helpful if I could run the code in Access as well. Thanks in advance
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
You want to access the BuiltInProperties of the workbook through VBA...

Below is an example:

Code:
Sub wbproperties_()

Dim mywb As Workbook

Set mywb = ActiveWorkbook

myauthor = mywb.BuiltinDocumentProperties("Author")

MsgBox myauthor

Set mywb = Nothing
End Sub

Remember to make sure your object references are correct especially if you are going to do this in Access.
 
Upvote 0
Hi,
Extracting of the Author's name from closed workbook as well as from some other types of files:
Rich (BB code):

'ZVI:2010-06-24 http://www.mrexcel.com/forum/showthread.php?t=476634
Function GetExtFileAuthor(PathName As String, FileName As String) As String
  If Dir(PathName & IIf(Right(PathName, 1) <> "\", "\", "") & FileName) = "" Then Exit Function
  With CreateObject("Shell.Application").Namespace((PathName))
    GetExtFileAuthor = .GetDetailsOf(.ParseName((FileName)), 9)
  End With
End Function

Sub Test()
  Debug.Print GetExtFileAuthor("C:\Tmp", "Test.xls")
End Sub
Regards,
Vladimir
 
Upvote 0
Example of referencing a closed Excel file...

Code:
Sub wbproperties_()

Dim mywb As Excel.Workbook
Dim myauthor As String, sFullName, sPath, sFile
Dim iSlash As Integer
Dim mybook As Object

On Error Resume Next
sFullName = Application.GetOpenFilename("Excel files (*.xlsm), *.xlsm")
Set mybook = GetObject(sFullName)

iSlash = InStrRev(sFullName, "\")
sPath = Left$(sFullName, iSlash - 1)
sFile = Mid$(sFullName, iSlash + 1)

Set mywb = Workbooks(sFile)

myauthor = mywb.BuiltinDocumentProperties("Author")

MsgBox myauthor

Set mybook = Nothing
Set mywb = Nothing

End Sub
 
Upvote 0
Example of referencing a closed Excel file...
Code:
Sub wbproperties_()
...
End Sub
This loads workbook into Excel and even not closes it.
Choose Excel 2003 menu Window-Unhide to find it hidden in Excel
For Excel 2007 choose ribbon’s tab View - Unhide
 
Upvote 0
Good Point...

Just add mybook.Close(False) event to close the object before clearing all object references...
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,262
Members
452,627
Latest member
KitkatToby

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