Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

BOM to Excel 2003 problem

Status
Not open for further replies.

Teabags

Mechanical
Feb 23, 2007
26
0
0
US
For some reason Catia is outputing blank BOM's in excel. I can save .txt's and html's no problem, but .xls comes out empty. I am running Windows x64 and Office 2003. Is there some setting I am overlooking? Is it a 64bit incompatibility? My coworker can output a BOM into excel without any problem on his 32 bit machine. Any help will be greatly appreciated.
 
Replies continue below

Recommended for you

I use this code to pull the BOM into Excel

Dim oRootDoc
Dim oRootProd
Dim assemblyConvertor1
Set CATIA = GetObject(, "CATIA.Application")
Set oRootDoc = CATIA.ActiveDocument
Set oRootProd = oRootDoc.Product
Set assemblyConvertor1 = oRootProd.GetItem("BillOfMaterial")

Dim arrayOfVariantOfBSTR1(11)
arrayOfVariantOfBSTR1(0) = "Part Number"
arrayOfVariantOfBSTR1(1) = "Quantity"
arrayOfVariantOfBSTR1(2) = "UM"
arrayOfVariantOfBSTR1(3) = "Material"
arrayOfVariantOfBSTR1(4) = "NumeroDeCatalogo"
arrayOfVariantOfBSTR1(5) = "ScrewsName"
arrayOfVariantOfBSTR1(6) = "ScrewsQty"
arrayOfVariantOfBSTR1(7) = "ScrewType"
arrayOfVariantOfBSTR1(8) = "DowelName"
arrayOfVariantOfBSTR1(9) = "DowelQty"
arrayOfVariantOfBSTR1(10) = "DowelType"


Dim assemblyConvertor1Variant As Object
Set assemblyConvertor1Variant = assemblyConvertor1
assemblyConvertor1Variant.SetCurrentFormat arrayOfVariantOfBSTR1

Dim NumOfProducts As Integer
Dim i As Integer
Dim oSubProd 'As product
Dim SourceFileName As String
Dim NumOfSubProducts As Integer

NumOfProducts = oRootProd.Products.count
i = 2
For i = 1 To (NumOfProducts)


Set oSubProd = oRootProd.Products.Item(i)
SourceFileName = Folder & "\" & oSubProd.Name & ".xls"

oSubProd.ExtractBOM catFileTypeHTML, SourceFileName
 
Status
Not open for further replies.
Back
Top