How to Export Bill of Materials to Excel with Thumbnails Using a SOLIDWORKS Macro

Export Bill of Materials to Excel with thumbnails

If you’re using SOLIDWORKS 2018 or older, automating the export of your Bill of Materials (BOM) to Excel with thumbnails can be incredibly beneficial. This process not only saves time but also provides visual representation, improving clarity and communication with other team members. In this article, we’ll walk you through how to use a macro to automate the export of BOMs, including thumbnails, directly into Excel.

This tutorial will show you how to set up, run, and use the macro to export parts-only BOMs with thumbnail previews. Keep in mind that this macro is designed for smaller assemblies; for larger ones, consider alternatives like xlBOM with thumbnails or PDM2Excel, which can handle more complex assemblies.

Why Use a Macro for BOM Export in SOLIDWORKS?

Manually exporting a BOM and adding thumbnails in Excel can be tedious, especially in older versions of SOLIDWORKS. By using a SOLIDWORKS macro, you can streamline the process and avoid repetitive tasks, allowing you to:

  • Quickly export BOMs with thumbnails.
  • Automate Excel integration for better BOM management.
  • Improve team communication with visual components in BOMs.

Requirements:

  • SOLIDWORKS 2018 or older.
  • Microsoft Excel must be installed to run the macro successfully.
  • This macro works only for parts-only BOMs.

Step-by-Step Guide to Using the Macro

Follow these steps to set up and run the macro in SOLIDWORKS:

1. Open SOLIDWORKS and Load the Drawing

Ensure you have a drawing with a Bill of Materials (BOM) loaded and active in SOLIDWORKS. The macro will work only if a BOM feature is present in the drawing.

2. Create a New Macro

Go to Tools > Macro > New… and save the macro in a location of your choice.

3. Insert the VBA Code

After saving the macro, the Visual Basic for Applications (VBE) window will open. Here, clear the default text and copy-paste the VBA code provided below:

4. Select the Bill of Materials in SOLIDWORKS

Make sure the Bill of Materials feature is selected in your SOLIDWORKS drawing and that nothing else is selected. This step is essential for the macro to run correctly.

5. Run the Macro

  • Click the green play button in the macro toolbar.
  • If a dialog box appears asking which subroutine to run, choose main and click Run.

The macro will now start running and export the BOM to Excel, complete with thumbnail previews for each visible component.

How the Macro Works

  • Exports BOM to Excel: Once the macro runs, it opens a new Excel session and copies the BOM data there.
  • Thumbnails for Each Component: For each visible component in the BOM, a thumbnail preview is generated in Excel, providing a visual reference.
  • Parts-Only BOM: This macro only works for parts-only BOMs and will not work with assemblies or sub-assemblies.

Limitations of the Macro

While this macro can significantly speed up the process of exporting BOMs with thumbnails, it has some limitations:

  • Cannot process large assemblies: If you’re working with large assemblies, this macro may not be able to handle the workload efficiently.
  • Compatibility: This macro is primarily designed for SOLIDWORKS 2018 and older versions. If you’re using a more recent version, consider other tools or solutions for better functionality.

For more complex assemblies or additional features, consider using advanced tools like xlBOM. This tool can handle larger assemblies and provides more robust export capabilities.

Why Choose Automation for BOM Export?

Automating the BOM export process in SOLIDWORKS VBA saves you time and effort, especially when dealing with repetitive tasks. By integrating thumbnail previews in Excel, you make it easier for stakeholders to visualize the components, which is critical in manufacturing and design reviews.


Need Help with SOLIDWORKS Automation?

At Blue Byte Systems, we specialize in automating SOLIDWORKS and PDM processes. If you need help with automating tasks, optimizing workflows, or building custom solutions for your company, contact us today. We can help streamline your design process and enhance productivity.

Reach out to Blue Byte Systems for expert assistance in automating your SOLIDWORKS workflows and BOM export processes.

Found an error or have suggestions? Send corrections via the comment section below. 👇

35 Comments

Comments are closed.

📝 Subscribe Now and join our community for goodies and more!