Author Topic: Calling model script from excel VBA  (Read 2593 times)

bilon

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Calling model script from excel VBA
« on: March 28, 2020, 03:11:37 am »
Is there any way how to call a procedure in model script from a procedure in excel VBA?

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Calling model script from excel VBA
« Reply #1 on: March 28, 2020, 03:28:12 am »
Not really.

EA's API doesn't expose scripts, and it doesn't have any function to execute scripts (let alone parts of scripts)

What you could do (if you really want this) is query the database to get the script code, stitch it together (interprete the !INC statements) and then feed it into a ScriptController class.
Then you can execute procedures defined in the scripts.

I do something similar in EA-Matic, for which you can find the code here: https://github.com/GeertBellekens/Enterprise-Architect-Toolpack/tree/master/EAScriptAddin

Geert

bilon

  • EA User
  • **
  • Posts: 85
  • Karma: +0/-0
    • View Profile
Re: Calling model script from excel VBA
« Reply #2 on: March 28, 2020, 08:16:20 am »
It looks pretty complex. I'm definitely not going to use it. Thanks anyway!