Subject: Using ReadFromFile from the API Posted: 3/21/2017 Viewed: 3680 times
I'm currently needing to import a large amount of variables into one of my models. As such I'm trying to get to grips with the API. Currently using VBScript as my approach although I'm open to alternatives.
I'd like to use the ReadFromFile function to import my data.
Within WEAP I've successfully ran this to import data to one of my river headflows:
However, when I try to call that out of the Immediate VB window in Excel using:
W.Branch("\Supply and Resources\River\KEG_River_26").Variables("Headflow").Expression = ReadFromFile("D:/TEMP(WEAPDATA)/Example_Flow.csv", Flow, , Sum)
I hit an error:
Compile error: Sub or Function not defined.
Would anyone be able to offer advice on this? The main question being am I trying to use ReadFromFile correctly out of Excel. I couldn't find an example of this in the manual but I did find variables being set to values e.g. ...Expression = 30 which I have been able to replicate.