Thread: VBA_EngetLinkid
View Single Post
  #1 (permalink)  
Old 07-18-2008, 08:34 AM
bma bma is offline
Registered User
 
Join Date: Jul 2008
Posts: 2
VBA_EngetLinkid

Hi all,
I am working on EPANET from Excel VBA.
I've some problem with function Engetlinkid or Engetnodeid.

My code for getting linkid from index is :

Sub getid()
Dim Myinp As Variant
Dim Myreport As Variant
Dim linkindex As Variant
Dim linkid As Long

'get variables from user
linkindex = Worksheets(1).Cells(16, 2).Value
Myinp = Worksheets(1).Cells(4, 1).Value
Myreport = Worksheets(1).Cells(5, 1).Value
'---------------------------------------------------------------'
'result

ENopen Myinp, Myreport, ""
ENgetlinkid linkindex, linkid
Worksheets(1).Cells(17, 2) = linkid
ENclose
End Sub



With this vba code, Excel return nothing in my variable Linkid from linkindex (or node id from nodeindex)
I've tried to change engetlinkid from engetlinkindex and excel return the good index of link (or node) from link id ...

so please, help me.

thanks all !
Reply With Quote