Copy/paste Bill of Materials to Excel

Hello,

I wanted to know if it was possible to copy/paste part of the bill of materials from a plan to paste it into an Excel file? (without going through a "save as" of the bill of materials and create an Excel file)
Do you have a trick or is it not possible?

Thank you

Hello,

The kings of the macro will tell you that everything is possible (macro that saves in Excel export format and then copies the table to allow you to have it in your Windows copy/paste stack, then delete the file we just created).

Otherwise there doesn't seem to be a direct copy solution (in 2020 anyway).

Then you have the historical ' relou ' solution: you remove your SW nomenclature, you put an old nomenclature back in Excel format which can be edited by right-clicking in Excel → possible to copy it

2 Likes

Hello @Guillaume_REBOUSSIN

One question, why without saving as? It's a simple solution, which would suit you.

Indeed copy/paste does not work, only in the other direction (Excel to SW)

1 Like

@froussel

Because I have to extract a dozen nomenclatures to join them in the same excel file... so it would be much more practical to copy/paste

Hello,

In this case by macro, no other native solutions except the one offered by @froussel

1 Like

Extracting by macro (@Cyril_f ) and compiled by the same macro is possible it seems to me.
This is equivalent to a saved-under + file compilation.

1 Like

Hello,

Below is a rudimentary macro that copies the selected area of the BOM to the Windows clipboard (thanks to the AI...).
No multiple selections possible.

All that remains is to paste the result into Excel.

[Edit - Modified macro, available below]

Hello,
Without the AI, I already have an existing code to extract the data from a nomenclature line (I think I have already provided it for another request of the same type on this forum).
You can also manipulate Excel directly from the macro launched in SW and copy/paste directly without waiting for the user to intervene.

1 Like

Hello,
I take the opposite view, but we can consider assembling all the parts, even without positioning, and making a nomenclature.

Very good suggestion to @Cyril_f, copy/paste in a single macro from Solidworks.
Procedure:

  • In Excel, select the destination cell;
  • In Solidworks, select the BOM range to copy/paste;
  • Run the macro from Solidworks.

Confirmation is requested if the destination range in Excel is not empty.

StructureEiffel.swp (67 KB)

1 Like

Here is one of the topics for retrieving data from tables
Reading BOMs - Macro - myCAD Forum
And another one to export to Excel
Export Bill of Materials to Excel with a VBA Macro - Macro - myCAD Forum

1 Like

Hello,

In all these solutions, the problem of updating the bill of materials will remain in the event of a change in the assembly. So, advice remain vigilant

Hello,

Treatment can always be added to manage this case :slight_smile:

Data can be linked between Excel files to update automatically.
Excel will require you to enable binding updates, or update them manually.
The macro must create files for each nomenclature and then in a compilation file you update with each update.
I think you need to create a value in the SolidWorks BOM that can then be filtered later, either through the macro or through Excel, a date for example.
Is it possible :thinking:

Hi I had made this macro a while ago and I still use it.

You select a table, or a cell it doesn't matter, you launch the macro

and then you have more than a Ctrl+V in an Excel cell, that's it.

CopyBomToExcel.swp (48 KB)