REFPROP在Excel上的应用(x64)
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Excel Applications.The Refprop.xls file that comes with the program has Visual Basic (VB) code embedded within it to make the connection between the workbook and the Refprop DLL. However, when working with anything other than temporary calculations, it is best to start with a blank workbook that does not have the VB code. In this manner, future updates to the Refprop program can be made available to all of your old workbooks through the instructions below.
To make the Excel routines in Refprop available to any worksheet in 9.0 (in version 9.1, this is done automatically for you during the installation), two environment variables called RPprefix and Path should be added (you will need administrative rights in order to do this) in a similar manner as shown below in the User variables section:
Do not add these to your System variables section (and more importantly, do NOT damage your path statement in the System variables section!).
In XP, the environment variables can be set under Start/Settings/Control
Panel/System/Advanced/Environment Variables, under the "User variables" option. In Windows 7, this can be found in Start/Control Panel/System And
Security/System/Change settings/Advanced/Environment variables.
In 64-bit versions of Windows, Microsoft added another Program Files directory
called "Program Files (x86)", which is the default directory where Refprop gets installed. For the connections to work, you need to either point to this directory in your path statement or copy all the Refprop files to the old "Program Files" directory.
The property quality in versions 7 and 8 was assumed to always be given on a molar basis, even though it was labeled as on a mass basis when mass units were in effect (this only affects mixture calculations). The updated file below returns the correct values..
Refprop.xls (last updated June 10, 2014)
For 64-bit Excel and users of Refprop 9.0, the following file should be placed in your Refprop directory (an updated file comes with 9.1):
REFPRP64.DLL
If an error message such as "...is not a valid Win32 application" occurs, try downloading the file again, most likely the file was corrupted during the first attempt
When you run the new Refprop.exe file, if you get the error message "File not found: REFPROP.DLL", download the 32 bit file below and install it on your machine (double click on the file). If you are connecting Refprop with a 64 bit version of Excel and you get “#VALUE”, download the 64 bit file and install it as well. This also applies to other 64 programs that are connected to Refprop.
w_fcompxe_redist_ia32_2011.0.104.msi
w_fcompxe_redist_intel64_2011.0.104.msi
The following outlines the procedure for using REFPROP within any spreadsheet in Office 2007 or 2010:
1. Open REFPROP.xls and save it as an add-in, REFPROP.xla or REFPROP.xlam, in the main REFPROP folder, C:\Program Files\REFPROP.
2. Go to File/Options/Trust Center/Trust Center Settings (button at bottom right).
3. Select "Trusted Locations" on the left. Click "Add new location". Browse to C:\Program Files\REFPROP, select "Subfolders of this location are also trusted", and click "OK".
4. Go to File/Options/Add-Ins and select "Excel Add-ins" in the Manage drop-down box at the bottom, and click Go.
5. Click "Browse", and navigate to C:\Program Files\REFPROP, select REFPROP.xlam and click OK. IMPORTANT: Do not simply select REFPROP.xlam when it first comes up, as this will be in the wrong folder (C:\Documents and Settings\Username\Application Data\Microsoft\AddIns), which is not trusted and will not work.
6. Select the Data tab, and click on Edit Links. Select REFPROP.xlam. Click on Change Source and navigate to C:\Program Files\REFPROP. Select REFPROP.xlam there and click OK. (This is just to make sure you are connected to the correct Add-
in.) If the Data tab is greyed out, start typing in a Refprop command [such as
“=Density(“water”,“TP”,,300,1)] and the button should become active.
7. Once you have the xla or xlam file set up, you can open a brand new work book and the functions should be available to you. Do not continue working with the Refprop.xls file since it still contains the VB code that is also in the xlam file. In this manner, future updates from NIST of the Refprop.xls file can be resaved as the xlam file, and all of your work books will have access to the most recent code.
Other tips:
1. In some cases the macros may not work. Try saving the file as a macro-enabled workbook (under Save As…).
2. The xls file distributed with version 9.0 sometimes will give false answers depending on the sequence of calculations if multiple xls files are open. Switching between the open files may cause the initial setup to be lost. The updated xls file given above fixes this.
3. For inputs that do not required a 5th parameter, Excel may require the comma at the end, for example: =Pressure("water", "TVAP", "SI", 298,)
4. If Excel cannot find the Refprop fluid files, you can copy the *.FLD and
HMX.BNC files into a default directory: C:\REFPROP\FLUIDS. When the program fails to find the fluid files, it will look to see if a C:\REFPROP\FLUIDS (or D:) is available, and if so it will use the files from that source.
5. If you see dual entries for each function in your workbook, then you have either saved two xla files, or you are working with a file that still contains the VB code. Start with a blank workbook to eliminate the dual entries for the latter case.
There have been a number of users who have had problems with the Excel link to Refprop. In some of these cases and in other situations we have found that the refprop.dll file had also been installed in either the c:\windows directory or the
c:\windows\system32 directory. If you experience problems, please do a full hard drive search for refprop.dll and delete all occurrences except the one in your
c:\program files\refprop directory.
Please send questions to Eric Lemmon: Eric.Lemmon@
(If you send a question and do not receive a response within several days, it is quite likely that your email did not make it or that my email was removed
by your system administrators as spam or junk mail. I try to respond to all
emails within two days, so please write/call again if you do not receive a
response.)
Last modified: Sept. 22, 2014.。