#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
  #2 (permalink)  
Old 08-05-2008, 11:44 AM
bma bma is offline
Registered User
 
Join Date: Jul 2008
Posts: 2
that's ok !

It's just do to variable declaration :

instead of

Dim linkid As Long

it's better to write

Dim linkid As String * 15

thanks to AM
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 01:34 AM.