Run CATIA macro from Excel

Run CATIA macro from Excel

A person who won’t read has no advantage over one who can’t read. Mark Twain

CATIA macro productivity,new part catia macro

Introduction

How to run CATIA macro from Excel is very interesting topic. We already covered CATIA macro and Excel connections in this post. This will be an extension to that post. There are a lot of ways how can you run CATIA macro. There are also a lot of programming languages in which can you write CATIA macro.

On this link you can check basic ways to run CATIA macro. There are just a few simple ones. 

On the web, there are not too many topics about how to run CATIA macro from Excel. Our goal is to present this topic in an easy way so you can use the benefits of this approach. 

Why run CATIA macro from Excel?

There are a few reasons:

  • store a lot of necessary input data
  • easy way to change the input data 
  • use Excel advantages

Before we start with our macro, you can also check these posts on how to write macros in Excel. 

How to write macros in Excel

Create an Excel macro 

Of course, there are a lot of posts about how to write Excel macro, so if you need more knowledge about that, you can search the web.  

First Excel ...

Before we start with writing the macro, we need to cover some things in Excel.

  1. Start Excel Application
  2. Go to File > Options > Customize Ribbon and Check the Developer option.
  3. Go to Developer now and insert a new button
  4. When you draw the button, you will get this menu pop up
  5. You can go now on the New button to create a new macro. If you just click OK on this menu, it is possible to come back on this menu. 
  6. You will get a new window Microsoft Visual Basic for Applications (VBA) where you can start to write the macro.

...and then CATIA macro

In this section, we can write more about macros. We will use our old macros from the website and just change some things. We will use three macros: 

  • Add the new part (link)
  • Change color (link)
  • Add new body(link)

You can read more about these macros on the links. In this way, it is easier to understand the used macro in this example.

This is an Excel file with the created macros inside.

Code for New Part.

Code for color macro.

Code for Add new Body macro.

There are a lot of macros that you can create in Excel and benefit from it. These are just simple examples that help you better understand this topic.

Please watch the video for a better understanding. 

You can download the Excel file here.

3 thoughts on “Run CATIA macro from Excel

  • July 22, 2021 at 6:01 pm
    Permalink

    Hi,

    You are doing a great work. I need to ask if the same applies also for the drawing workbench? so I mean can we make a macro in excel for texts in 2D Drawing? is it too difficult. Any comments are high appreciable. Thanks

    Kind Regards

    Samkit

    Reply
    • July 22, 2021 at 8:47 pm
      Permalink

      Hi, thx a lot. Yes, I think there are no problems with that. I don’t know what do you want to archive?
      The procedure is the same.

      Reply
  • July 14, 2022 at 3:27 pm
    Permalink

    Hey your contact window has some sort of glitch
    I have some doubts please mail me

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *