Here is a VBA rule that will query files using the apprentice server tested in Inventor 2020 and called from excel VBA. It is just returning one file at the moment but you can adapt from there.
'https://forums.autodesk.com/t5/inventor-customization/determining-if-references-are-missing-before-opening-an-iam-file/td-p/3518626
'Filename is path, Name and ext
Dim filename
Dim outputstring
Sub StartProcessingFiles()
filename = InputBox("Input FileName & Path & ExtTo Search For Information", "Enter Path Information")
If filename = "" Then
WScript.Quit
End If
Call GetInformation
oTextSave = "C:\temp\iLogicBuffer.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Set oWrite = fso.CreateTextFile(oTextSave, True)
oWrite.WriteLine ("")
oWrite.WriteLine ("File Checked: " & filename)
oWrite.WriteLine (outputstring)
oWrite.Close
Dim WshShell
Dim oExev
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("notepad " & oTextSave)
Set oExec = Nothing
Set WshShell = Nothing
End Sub
Sub GetInformation()
On Error Resume Next
Dim invApprenticeApp
Set invApprenticeApp = CreateObject("Inventor.ApprenticeServer")
Dim invApprenticeDoc
Set invApprenticeDoc = invApprenticeApp.Open(filename)
Dim oFM
Set oFM = invApprenticeApp.FileManager
Dim oMainFile
Set oMainFile = oFM.Files(filename)
If oFM Is Nothing Then
Exit Sub
End If
PartNumber = invApprenticeDoc.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value
outputstring = outputstring & " " & PartNumber & vbCrLf
MsgBox (PartNumber)
invApprenticeApp.Close
Set invApprenticeApp = Nothing
End Sub
If you want you can use vb script file (.vbs) on the desktop. It is the same as the VBA rule with small differences. To make it run in .vbs just call the first sub routine.

Dim filename
Dim outputstring
Call StartProcessingFiles 'Used to call the rule from VB.Script
Sub StartProcessingFiles()
If this solved a problem, please click (accept) as solution.
Or if this helped you, please, click (like)
Regards
Alan