Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: annavp on June 09, 2004, 02:23:45 am
-
Hi,
I am working with a registered version 4.00. I read in the release notes that the CreateObject bugs should be fixed as from version 3.60.
I'm creating a .VBS (visual basic script) file and I want to access an existing EA repository. I use the following script:
____________________________________________
Set MyRep = CreateObject("EA.Repository")
myrep.OpenFile ctEAPName
......
____________________________________________
I also tried
____________________________________________
Set MyRep = GetObject("", "EA.Repository")
____________________________________________
but I got the same problem.
Any thoughts?
Thanx, anna
-
I suspect your problem lies elsewhere, or you may have a corrupted installation of EA (try reinstalling as a last resort). The following code snippet works fine on my pc:
Set myrep = CreateObject("EA.Repository")
result = myrep.OpenFile("Z:\Model.EAP")
MsgBox result
myrep.Exit
At risk of stating the obvious, your model file does exist doesn't it?
Cheers
Jon
-
Yep
model exists!!!
I tried this one and that works but I cna't use this in a script.
Dim myrep As New EA.Repository
myrep.OpenFile ctEAPName
anna
-
I tried this piece of code and I get
"could not open file" message
code:
[size=10]Set MyRep = CreateObject("EA.Repository")
If Not myrep.OpenFile(ctEAPName) = False Then
MsgBox "Repository opened!"
Else
MsgBox "Could not open file!"
End If[/size]
anna
-
have you reimported the type library after updating to the registered version?
I had a similar problem in my delphi apps.
Bas