Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: watchdogtimer on January 12, 2004, 04:00:35 pm

Title: Automation Error
Post by: watchdogtimer on January 12, 2004, 04:00:35 pm
I am receiving an error trying to add an element to a package by using a TextStream in VB.

the following error is generated when I run e.Update to update the element

Run-time error '-2147417851 (80010105)':

Automation error
The server threw and exception


The code that breaks is:


       Set ts = fso.OpenTextFile(Text1)
       ts.ReadLine
       s = Split(ts.ReadLine, ",")
       Set e = Package.Elements.AddNew(s(1), s(3))
       e.Update
       Package.Update

The code that works that does not use a textStream is:

       Set e = Package.Elements.AddNew("new req", "Requirement")
       e.Update
       Package.Update


If there some limitation in the Automation Interface that does not allow using a text stream?