PDA

View Full Version : IWS VBA COM Interface



Guillermo
May 20, 2016, 01:31 AM
Hello everybody,

I'm trying to program some tasks using VBA in Infoworks WS and I'm getting some trouble. I have some very old manuals about COM Interface and I'm testing the commands. Has anybody programed using VBA? Do the commands still work? I am trying the following code to run an already created simulation.


Sub Run ()



Dim IW As InfoWorksWSLib.InfoWorksWS


Set IW = New InfoWorksWSLib.InfoWorksWS
IW.InitForTest 2, "", ""
dim Run As String
Run = ">CG~Network>WNRUNG~Test Run Group>WNRUN~Run"
IW.WNRun (Run)


End Sub



When the program arrives to IW.WNRun (Run) (which should run an already created simulation) I get '80010115' error. I am using InfoWorks WS 16.5 and I have added Innovyze InfoWorks WS 30.0 Type Library.

Regards,