AnsweredAssumed Answered

Export BOM certain way

Question asked by Sanya Shmidt on Mar 1, 2016
Latest reply on Mar 1, 2016 by Sanya Shmidt

Hello Everybody,


Is there a way to change the code below so it doesn't export the sheet lines see picture



' choose bom type

Private Sub but_Export_Click()

    Const BOMTemplate As String = "C:\....\BOMS\EXCEL BOM SORT.sldbomtbt"

    Dim OutputPath As String

    strUName = CreateObject("WScript.Network").UserName

    OutputPath = "C:\Users\" & strUName & "\Desktop\"


    Dim ConfigName As String

    Set swApp = Application.SldWorks

    Set swModel = swApp.ActiveDoc

   ConfigName = swModel.GetActiveConfiguration.Name


        Set swBomTable = swModel.Extension.InsertBomTable(BOMTemplate, 0, 0, swBomType_e.swBomType_PartsOnly, ConfigName)


    Set swTable = swBomTable

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

    Set swAnn = swTable.GetAnnotation

    swAnn.Select3 False, Nothing


    MsgBox ("All done. Excel document saved on your desktop."), vbInformation

End Sub