Dear Chip,
Here is my VBA declaration:
Declare Function steam67 Lib "steam67.dll" (ByRef temperature As
Double, ByRef pressure As Double, ByRef quality As Double, ByRef
weight As Double, ByRef enthalpy As Double, ByRef entropy As Double,
ByRef saturation_temperature As Double, ByRef saturation_pressure As
Double, ByRef degrees_superheat As Double, ByRef degrees_subcooling As
Double, ByRef viscosity As Double, ByRef critical_velocity As Double,
ByVal action As Integer) As Integer
I have put steam67.dll in C:\Windows\System32 folder
Then I am calling this dll in following function:
Public Function flash67(temperature As Double, _
pressure As Double, _
quality As Double, _
enthalpy As Double, _
entropy As Double) As Variant
Dim weight As Double
Dim saturation_temperature As Double
Dim saturation_pressure As Double
Dim degrees_superheat As Double
Dim degrees_subcooling As Double
Dim viscosity As Double
Dim critical_velocity As Double
Dim action As Integer
Dim iret As Integer
action = 2 'viscosity=1, crit_vel=2
iret = steam67(temperature, pressure, quality, weight, enthalpy,
entropy, saturation_temperature, saturation_pressure,
degrees_superheat, degrees_subcooling, viscosity, critical_velocity,
action)
flash67 = Array(temperature, pressure, quality, weight, enthalpy,
entropy, saturation_temperature, saturation_pressure,
degrees_superheat, degrees_subcooling, viscosity, critical_velocity)
End Function
I am getting error at iret = steam67(temperature, pressure ....) line
of the code. I don't know what but I think there is a problem of using
this line in office 2003. Office XP (2002) uses the same structure of
the program and does not give any error.
In steam67.h file I checked the data type and they are as following:
int steam67(double *temperature, double *pressure, double *quality,
double *weight, double *enthalpy, double *entropy, double
*saturation_temperature, double *saturation_pressure, double
*degrees_superheat, double *degrees_subcooling, double *viscosity,
double *critical_velocity, int action);
I will greatly appreciate your help. Thanks