Hello again, thanks for the answer.
I tried using the code, and it did one of the things I meant it to do (name of the file in the excel), but then, (knowing nothing about ILogic) I tried to modify it in order to fullfill my second requirement.
I tried this one and several other things that came to mind, but without success, maybe one of you sees how to make it work?
I have the "PRIMERA LINEA" and the "SEGUNDA LINEA" as custom iproperties (I wrote two lines at the top of the code to make them show as parameters as well, but if that can be avoided would be even better).
Other than that, it's the 32th line the one that has the problem (or at least it says that in my computer when running the code)
Please help
PRIMERA_LINEA = ThisDoc.FileName(False) 'without extension
iProperties.Value("Custom", "PRIMERA LINEA") = PRIMERA_LINEA
Dim drawing As DrawingDocument = ThisDoc.Document
Dim partsList As PartsList = drawing.ActiveSheet.PartsLists(1)
Dim bomFileName = "C:\Temp\BOM.xlsx"
'Options
'Name Value Type Valid For export formats
'-------------------------------------------------------------
'TableName String kMicrosoftExcel, kMicrosoftAccess
'ExportedColumns String containing semicolon separated column titles All
'IncludeTitle Boolean kMicrosoftExcel, kTextFileCommaDelimited, kTextFileTabDelimited, kUnicodeTextFileCommaDelimited, kUnicodeTextFileTabDelimited
'StartingCell String kMicrosoftExcel
'Template String kMicrosoftExcel
'AutoFitColumnWidth Boolean kMicrosoftExcel
Dim options As NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap()
options.Value("TableName") = "BOM"
options.Value("StartingCell") = "A3"
partsList.Export(bomFileName, PartsListFileFormatEnum.kMicrosoftExcel, options)
'Add additional info
Dim fileName = ThisDoc.FileName(False)
GoExcel.Open(bomFileName, "BOM")
GoExcel.CellValue("A1") = "fileName"
GoExcel.CellValue("B1") = fileName
Dim PrimeraLinea = InventorVb.checkParameters ("SEGUNDA_LINEA")
GoExcel.Open(bomFileName, "BOM")
GoExcel.CellValue("C1") = "segunda linea"
GoExcel.CellValue("D1") = PrimeraLinea
GoExcel.Save
GoExcel.Close