Simple VBA Excel to EA importer v2
There is an updated version available. Check out EA Excel Importer V4
The Excel to EA importer is a rather simple tool to import stuff into EA.
It has been available on the Sparx Community Site since 2009 and it has always been one of the most popular resources.
Now I decided to improve it a little bit and publish version 2.
Download the excel file here: EAExcelImporter_v2
Columns A till F are used in the sheet. Fill in the the columns with your own data.
Fill in the type of the Element you wish to import. This column should contain either Attribute or one of the EA Element types as defined in the documentation of EA.Element.Type. An attribute will be added to the last specified Element.
The name of the element or attribute.
The stereotype of the element or attribute. Use null to specify an empty stereotype.
The description of the element or attribute.
- Attribute Type
The type of the attribute. This column should not be used for Elements. Use null to specify an empty type.
- Attribute Length
This value will be added as a tagged value with the name length on the attribute. Again this is only for attributes.
Once all you data has been filled in you can either run the macro (Alt-F8) importFromExcel or press the Import button
The code of this little tool is embedded as VBA in the document, and as such can be edited by anyone with basic programming skills.
To open the code editor press Alt-F11.
There are three major parts for the code
The module that contains the importFromExcel macro. This is where you want to make changes.
A facade for EA’s API containing all kinds of useful functions. You probably don’t need to change anything here.
A facade for Excel with the code to get the values of the sheet. Again probably no need to change anything here.
Both the Excel file as the VBA code embedded in it is free for use. Just be kind and leave the reference to my name in the code if you use it.
you should mention that this script makes the same thing as the “CSV Import/Export…” in EA except the attributes. And that’s why your script is so useful.
Presumably it could also be adapted to create relationships of specified types between objects?
… and is it possible to use the Stereotype to refer to a profile with custom stereotypes e.g. MyProfile::MyStereotype … so that I can use my specialisation of a Requirement class for example?
Relationships is definitely something you could add, that’s relatively easy.
You should try it, but I think the MyProfile::MyStereotype should work. The VBA part will just treat it as a string.
You might need to call an additional EA.Repository.SynchProfile() (or something like that) to get all the tagged values and other stuff that comes with eh stereotype.
Thanks, Geert – as ever this might help solve a number of problems – 1) trying to illustrate the dependencies using a spreadsheet with 800+ rows of connections; 2) overcoming the limitation that comes with the DOORS importer that only works with the basic Requirement class (I’d like to use the TRAK profile that extends this).
Allright, let me know how it turns out.
I modified your importer to import glossary items. I think it would be a useful extension since manually entering glossary terms is quite cumbersome (or am i missing something?). If you think so too let me know and i’ll send you the modifications (the are straightforward).
That would indeed be interesting. If you send me the file I’ll try to include it in the next version.
I would like to have the copy that allows importing glossary items. If you have it available could you send it to me please? Thank you.
Did you manage to update this to allow glossary items to be imported?
No sorry. I haven’t found the time yet.
I’m going to try to whip up a version for the glossary in the next few week.
Version 3 including an import glossary function is a fact: Simple VBA Excel to EA importer v3
I managed to write the VB code myself following your example & Paulus.
Thank you both.
Hi, does this importer work for importing use case steps into the structured specifications tab? Thanks.
No, not as is, but I believe you should be able to modify it in order to import use cases and scenario’s.
In that case you should be importing EA.Element of type UseCase, EA.Scenario and EA.ScenarioStep in stead of just Element and Attribute.
How does it know in which EAP file or package it will import?
I get an error :”Compile error: can’t find project or library”, debug stops at “Public Sub importFromExcel()”
first open your model, then start the import.
Ok, it works, thanks!
This importer is great – so useful for importing large coded domains. I’m trying to import code lists for use with the ArcGIS UML Profile which uses the initial value as an alias. How can I configure VBA code to import a column into the initial value?
I can successfully import values into the alias but there is no option for Initial in the myAttribute.* public Function addOrUpdateAttribute in the EA Connector
I guess you’ll have to add that as a parameter to the function and then set EA.Attribute.Default to this value.
did you found a solution. I have the same Problem
Perfect, thank you :-)!!
Thanks Geert for VBA.. very useful.
Anyway, no clue how to solve problem with good export/import tool for interfaces.
MS integration is useless, eadocx useless as well.
I have lots of components which represents applicatio or system. every system has provided and required interface. Interfaces are created as separate object interface type and assigned to exposed interfaces joint with dependancy connection, or information flow connector.
I need to achive to show on one row in csv or xls where can I see ComponentA, ComponentB, information flow direction, or which component provide and require interface, and interface name link.
Is that possible to do it somehow with available tools?
If you are only looking for an export from EA to CSV or excel, might want to look into SQL searches.
I usually use those when I need to export something from EA to Excel. Only in exceptional cases, where the logic is too complex to be written in SQL, I use programming code to export data from EA.