<yqyq22@xxxxxx> wrote in message
news:a690233b-4001-41d2-b8aa-4a6cbd8df473@xxxxxx
> Hi all, i would like to optimize this code with a cicle, could someone
> help me please?
> Set server1 = CreateObject("WMSServer.Server", "server")
> Set server2 = CreateObject("WMSServer.Server", "server2")
> server1.PublishingPoints("Stress").stop
> server2.PublishingPoints("Stress").stop
>
> thanks a lot Maybe a loop like the one below is what you're after. It will result in less
verbose code but it won't speed up execution.
aServers = Split("Server1 Server2 Server3 Server4")
For i = 0 To UBound(aServers)
Set oServer = CreateObject("WMSServer.Server", aServers(i))
oServer.PublishingPoints("Stress").stop
Next