Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Errors while trying to export BOM to excel

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
m.rymut
345 Views, 2 Replies

Errors while trying to export BOM to excel

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.

 

 

 

2 REPLIES 2
Message 2 of 3
Ralf_Krieg
in reply to: m.rymut

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 GmbH
www.rkw-solutions.com
Message 3 of 3
m.rymut
in reply to: Ralf_Krieg

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report