Errors while trying to export BOM to excel

Errors while trying to export BOM to excel

m.rymut
Advocate Advocate
510 Views
2 Replies
Message 1 of 3

Errors while trying to export BOM to excel

m.rymut
Advocate
Advocate

Hi,

I was trying to make an iLogic rule that would let me export BOM to excel, but every code i tried resulted in an error.

I even tried to run it with iLogic original sniplet : 

ThisBOM.Export("Parts Only", "fileName", kMicrosoftExcelFormat)
'kMicrosoftAccessFormat			= Microsoft Access
'kMicrosoftExcelFormat			= Microsoft Excel
'kdBASEIIIFormat				= dBASE III
'kdBASEIVFormat				= dBASE IV
'kTextFileTabDelimitedFormat		= Text File Tab Delimited
'kTextFileCommaDelimitedFormat		= Text File Comma Delimited
'kUnicodeTextFileTabDelimitedFormat	= Unicode Text File Tab Delimited
'kUnicodeTextFileCommaDelimitedFormat	= Unicode Text File Comma Delimited

But i got an error too.

I get either this one:

 

mrymut_0-1637057300187.png

or this one:

mrymut_1-1637057330913.png

I searched this forum and the internet for help but i couldnt find anything that would let me solve the issue.

I am using Inventor Professional 2022.

 

 

 

0 Likes
Accepted solutions (1)
511 Views
2 Replies
Replies (2)
Message 2 of 3

Ralf_Krieg
Advisor
Advisor
Accepted solution

Hello

 

Can't translate the error messages, bu you should at least be sure that the parts only view is enabled before export. And you don't have "filename" in your rule as posted? There you must fill in the full path of your target Excel file.

 

 

Dim oDoc As AssemblyDocument = ThisDoc.Document
Dim oBOM As BOM = oDoc.ComponentDefinition.BOM

oBOM.PartsOnlyViewEnabled=True

ThisBOM.Export("Parts Only", "C:\Temp\TestBOMExport.xls", FileFormatEnum.kMicrosoftExcelFormat)

 


R. Krieg
RKW Solutions
www.rkw-solutions.com
Message 3 of 3

m.rymut
Advocate
Advocate
Your code works properly, but i dont really understand why, i will try to figure it out because i am sure that i had parts only view enabled and the filename was specified.
The rule i posted i just a copied sniplet, i tried to run a bunch of different rules.
Thanks a lot for the help, it is very appreciated.
0 Likes