Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: OpenIT Solutions on December 05, 2014, 02:21:42 am
-
Hi,
I've used Repository.Execute in C# without issue; I need to use it in a VBA code within an Excel sheet - i'm getting an 'object doesn't support this property or method' error. Is this a limitation of VBA - want recognize/allow the use of hidden methods ? Anyone come across this ?
Regards,
Jon.
-
It shouldn't be an issue. I used it from Perl without any issue. So VB should recognize it as well. The auto-completion would not work. Maybe VB just stops working when encountering such methods. How about Repository.CustomCommand?
q.
-
I'm using Repository.Execute in VB, like this:
rep.Execute("UPDATE T_DIAGRAM SET SHOWFOREIGN=FALSE WHERE DIAGRAM_ID=" & eD.DiagramID)
Regards,
Knut
-
Ah, I think VBA is a bit weird in these types of things.
If it considers something a "sub" (function with no return value) then you have to call it without parenthesis, or either add call.
So either this
rep.Execute "UPDATE T_DIAGRAM SET SHOWFOREIGN=FALSE WHERE DIAGRAM_ID=" & eD.DiagramIDor this
Call rep.Execute("UPDATE T_DIAGRAM SET SHOWFOREIGN=FALSE WHERE DIAGRAM_ID=" & eD.DiagramID)
Geert
-
OK - humble pie time - it wasn't repository.execute in vba - it was a typo in a method call being used to construct the sql on the fly....Thanks both for your help/input...