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?
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
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.
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
After retesting your macro, the copy paste is bad for cells containing paragrpahe breaks: when pasting in Excel it cuts the data into several cells instead of making a cell with text containing paragraph breaks.
A VBA pro should easily be able to correct this detail
Here is a ' functional ' code that ' solves ' the problem of line breaks/paragraph breaks (in brute mode after editing the code by M365 Copilot: I replaced all the characters that looked like a paragraph/line break and replaced it with a space. → Text imports well into a single cell
If someone manages to make it cleaner (and manages to put line references inside the text of the excel cell) he just has to repost.
NB: not sure if this is feasible since the macro goes through a string separated by tabs (which offset the cells when copying in Excel) and CRLFs (which make the reference to the next line). It would probably be necessary to completely rewrite the macro to have something really functional (that the macro creates a temporary Excel file, that pastes the text into the cells and that puts all the filled cells in the clipboard).