Save BOM as TXT

I need a macro that a macro that exports my BOM to a TXTfile, the problem is that i have some hidden columns that I toexport but I don't want to show in my Drawing.

Currently I have to show those columns just to create the txt filethan hidde then again. Does anyone have an example of somthing likethis? i would realy appreciate it!SolidworksApi macros
Comments 7
SF
SF 2008-08-01
See if myExportBOMmacro will do hidden cells, if not you can easily modifiy it to doso
DE
DE 2008-08-07
does it work with excel based BOM's? can't seem to get it towork for me. all it does is open excel and save an emptyspreadsheet. seems to only recognize my revision table which isn'texcel based.

really though i'm just wanting to use this for grabbing the bom toinput into an MRP system.

argh from a little searching it seems that the excel based tableannotations are going extinct. looks like we'll have to migrate tosolidworks based.
SF
SF 2008-08-07
It should open excel, export any BOM tables in the activedrawing file, and put them into the excel sheet then save. Checkyour Excel references in the macro (Tools->References...)
DE
DE 2008-08-07
1st thing i did was fix the references to my version ofexcel/SW

sw2k7 sp5
office 2k3
SF
SF 2008-08-08
Are you sure your tables are BOMs? To check either stepthrough the code or just remove this line:

If swTable.Type <>SwConst.swTableAnnotationType_e.swTableAnnotation_BillOfMaterialsThen Exit Sub
DE
DE 2008-08-08
i did do some testing and it did not detect my table. ireally don't need it to open excel more just read the info out ofthe table, but it just seems that since it's an excel based tablethat it's just not seeing it.

but since it reads the non-excel tables fairly easy it shouldn't bea problem just to use those from now on. i don't think there wasany special reason we were using them in the 1st place.
SF
SF 2008-08-08
Oh I see you had embedded activeX excel objects in yourdrawing to act as the tables... bad idea lol. Yes change them anddo what you said.