Add File Author Metadata to an Excel Power Query Folder Import
Question details
Add each document's author to a Power Query table imported from a folder.

- Product
- Microsoft Excel Power Query
- Device & OS
- not provided
- Scenario
- A user imports a folder of files and wants to include the author stored in each document's properties.
- Observed behavior
- The Folder connector exposes standard file metadata, but its Attributes record does not normally include the document author.
Identify the file types in the source folder and check whether they contain a populated Author document property. The PowerShell example below requires Windows, Microsoft Excel, and local XLSX files; it reads the folder itself, not subfolders.
Extract Excel file authors and merge them into Power Query
Use PowerShell to create an author lookup CSV, then join it to the folder query by full file path.
The Author document property is different from the file owner or the person who last modified the file. Other file types require a suitable document-property reader.
Run the script only on files you trust. It disables macros and link updates when opening the workbooks, but opening unknown files can still carry risks.
Open Windows PowerShell. Replace the two paths below with your source folder and a CSV location outside that folder, then run the script: $folder = 'C:\Files\Source' $csv = 'C:\Files\authors.csv' $excel = New-Object -ComObject Excel.Application $excel.Visible = $false $excel.DisplayAlerts = $false $excel.AutomationSecurity = 3 try { $rows = foreach ($f in Get-ChildItem -LiteralPath $folder -File -Filter '*.xlsx' | Where-Object { $_.Name -notlike '~$*' }) { $book = $null try { $book = $excel.Workbooks.Open($f.FullName, 0, $true) [PSCustomObject]@{ FullPath = $f.FullName; Author = $book.BuiltinDocumentProperties.Item('Author').Value } } catch { Write-Warning "Could not read $($f.FullName): $_" } finally { if ($null -ne $book) { $book.Close($false) } } } $rows | Export-Csv -LiteralPath $csv -NoTypeInformation -Encoding UTF8 } finally { $excel.Quit() [void][System.Runtime.InteropServices.Marshal]::ReleaseComObject($excel) }
In Excel, select Data > Get Data > From File > From Text/CSV, choose authors.csv, and select Transform Data.
In the folder query in Power Query Editor, select Add Column > Custom Column and create a column named FullPath with the formula [Folder Path] & [Name]. Make sure the paths match those in the CSV.
Select the folder query, choose Home > Merge Queries, and select FullPath in both the folder query and the author lookup. Use a Left Outer join, select OK, then expand the merged column and select Author.
Select Home > Close & Load. When files or author properties change, rerun the PowerShell script and then select Data > Refresh All in Excel.

Work with Excel author lists in WPS Spreadsheet
WPS Office is a free, lightweight alternative with a familiar interface and Excel format compatibility. Open your existing spreadsheets and work with a separately prepared file-author list while migrating your everyday spreadsheet work to WPS.

Frequently Asked Questions
Can Power Query get the document author from the Folder connector's Attributes column?
The standard Attributes record does not normally include the document author. Extract the property separately and merge the resulting lookup with the folder query.
Why should I merge on the full file path instead of the file name?
Files in different folders can have the same name. In Power Query Editor, use Add Column > Custom Column to combine [Folder Path] and [Name], then merge that value with the lookup's FullPath column.
Does refreshing the Power Query also update the author CSV?
No. Rerun the extraction script to update the CSV first, then use Data > Refresh All to reload and merge the latest values.
Will the PowerShell example read authors from Word or PDF files?
No. The example uses Excel to read the Author property from XLSX files. Word, PDF, and other formats need a reader or API that supports their document properties.
Why is an author's value blank after the merge?
The document may have no Author property value, the extraction may have failed, or the full paths may not match. Check the PowerShell warnings, the CSV, and the merge columns in Power Query Editor.




