Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

Excel - VBA: division by zero error #225

Open
andrei-ng opened this issue Jul 4, 2014 · 4 comments
Open

Excel - VBA: division by zero error #225

andrei-ng opened this issue Jul 4, 2014 · 4 comments

Comments

@andrei-ng
Copy link

Hi,

I am trying to use coolprop in a VBA macro in Excel. Either I am not using it properly or there is something wrong in DLL file.

When I call the Props function from VBA to evaluate the enthalpy based on Pressure value and Quality value ( for "water") the Props_private function in the CoolProp.xlam returns . The behavior is a bit chaotic as it can happen at almost any pressure value.

Does anybody have a suggestion or can offer an idea why this is happening ?

Thanks,
Andrei

@ibell
Copy link
Owner

ibell commented Jul 4, 2014

Can you post an excel file that demonstrates this problem? With the .dll file that you are using as well? What is the exact call that you are making to CoolProp?

@andrei-ng
Copy link
Author

Hi,

Attached is an excel file with some VBA code and the .dll I am using. The calls I am making as you will also see from the file are:

Tsat = Props("T", "P", temp_p, "Q", 0,"water") (where temp_P is a pressure value in 1000 kPa and 6000 kPa)

h_L = Props("H", "Q", 0, "P", temp_P, "water"

Both give the same type of error.

@andrei-ng andrei-ng reopened this Jul 4, 2014
@andrei-ng
Copy link
Author

Hi,

The calls I am making are:
Tsat = Props("T", "P", temp_p, "Q", 0,"water")
h_L = Props("H", "Q", 0, "P", temp_P, "water")
(where temp_P is a pressure value in 1000 and 6000 , assuming kPa as units to the Props function)

I run these calls in a for loop of >1000 values and the error is raised at about the 200th iteration, whichever call I invoke.

I will upload the file and .dll later, as I am new to github and I first need to discover how to do that. (Is sending them by email an option for you?)

Thank you,
Andrei

@ibell
Copy link
Owner

ibell commented Jul 4, 2014

Email is ok, try ian.h.bell .at. gmail.com.

On Fri, Jul 4, 2014 at 5:10 PM, gandrein [email protected] wrote:

Hi,

The calls I am making are:

Tsat = Props("T", "P", temp_p, "Q", 0,"water")

h_L = Props("H", "Q", 0, "P", temp_P, "water")
(where temp_P is a pressure value in 1000 and 6000 , assuming kPa as units
to the Props function)

I run these calls in a for loop of >1000 values and the error is raised at
about the 200th iteration, whichever call I invoke.

I will upload the file and .dll later, as I am new to github and I first
need to discover how to do that. (Is sending them by email an option for
you?)

Thank you,
Andrei


Reply to this email directly or view it on GitHub
#225 (comment).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants