AnsweredAssumed Answered

Macro to export a BOM with thumbnails to excel

Question asked by Marcos Ortíz on Nov 8, 2017
Latest reply on May 10, 2020 by Amen Allah Jlili

Hello everyone!


I'm looking for a macro to export a bom with thumbnails to excel, I have tried this from another post:



Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swBOMTable As SldWorks.BomTableAnnotation
Dim swTable As SldWorks.TableAnnotation
Dim swAnn As SldWorks.Annotation

Const BOMTemplate As String = ""
Const OutputPath As String = "C:\"


Sub main()

    Set swApp = Application.SldWorks
    Set swModel = swApp.ActiveDoc
    Set swBOMTable = swModel.Extension.InsertBomTable(BOMTemplate, 0, 0, swBomType_e.swBomType_Indented, "")
    Set swTable = swBOMTable


    swTable.SaveAsText OutputPath & "BOMTable_" & swModel.GetTitle() & ".xls", vbTab


    Set swAnn = swTable.GetAnnotation
    swAnn.Select3 False, Nothing
End Sub



It works but i still need the Thumbnails, I hope you can help me,


Thank you all.