Maybe this will work as you wanted. There are still more options we could have filled in though, if needed.
https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=PartsList_Export
Sub Main
If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then Exit Sub
Dim oDDoc As DrawingDocument = ThisDoc.Document
Dim oPList As PartsList = Nothing
Try : oPList = oDDoc.ActiveSheet.PartsLists.Item(1) : Catch : End Try
If oPList Is Nothing Then Exit Sub
Dim sPath As String = ThisDoc.Path
Dim sDefaultName As String = ThisDoc.FileName(False)
Dim sFileName As String = InputBox("Enter PartsList Excel File Name.", "Exported PartsList File Name", sDefaultName)
Dim sExcelFile As String = sPath & "\" & sFileName & ".xlsx"
oPList.Export(sExcelFile, PartsListFileFormatEnum.kMicrosoftExcel)
End Sub
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)