Book a Demo

Author Topic: Start EA from external application  (Read 3421 times)

nymo

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Start EA from external application
« on: November 26, 2013, 01:01:58 am »
Hi,

How can one start EA from VBA code? The below code illustrates what we are trying to do, but what is needed in order to open an EA project "by code" the correct way?

Set App = CreateObject("EA.App", "")
Set EaRepos = CreateObject("EA.App").Repository
EaRepos.GetProjectInterface.LoadProject ("C:\EAExample.eap")
App.Visible = True

The above code starts EA, but I need help in doing it the right way. E.g. what if one have a server side project, what path to use instead of "C:\EAExample.eap".

The objective for us is to run a scheduled job that will kick off an application that will start EA and dump all diagrams to a WEB-server directory, furthermore dump other relevant elements, to have the elements appear in the active context of an information consumer.

Sverre

Dermot

  • EA Administrator
  • EA User
  • *****
  • Posts: 591
  • Karma: +7/-0
    • View Profile
Re: Start EA from external application
« Reply #1 on: November 26, 2013, 04:01:00 pm »
GetProjectInterface() opens the Project Interface not the repository.
Best to use:
    EARepos.OpenFile (EaProjName)

OpenFile() does support an ODBC string as an argument for DBMS server repository - see help for more detail.
« Last Edit: November 26, 2013, 04:03:02 pm by Dermot »

nymo

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Start EA from external application
« Reply #2 on: November 26, 2013, 07:47:52 pm »
Thanks, it worked fine!