24小时热门版块排行榜    

查看: 7950  |  回复: 7
【奖励】 本帖被评价5次,作者Marss增加金币 3.8

Marss

铜虫 (初入文坛)


[资源] EXCEL调用REFPROP方法

EXCEL调用REFPROP的方法详见NIST官方推荐的网址:
https://github.com/usnistgov/REF ... ster/wrappers/Excel

      希望获得其他工具(MATLAB, Labview, C/C++, C#, VB, VB.NET)的调用方法可浏览下面的网址,本人仅测试过Excel和Python的调用,Python的调用可搜索CoolProp详细了解。
https://github.com/usnistgov/REFPROP-wrappers

在此感谢Github的Ian Bell提供方法并维护更新,本人Win10 64位,office2013版亲测成功,以下Excel调用REFPROP的内容摘录于Bell的原话:

Installation
      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","SI",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.

Notes for Windows users
      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.
      When making calculations of the critical point for mixtures, or when saturation states fail to converge, see:
http://www.boulder.nist.gov/div8 ... tm#SaturationStates
      If calculations do not appear to work and you are located outside of the U.S., try switching the period and comma, or the comma and semicolon, to enter the numbers in the format required by your version of Microsoft products. For example, try both of these to see which format is required:
        =Density("argon","TP","SI",325.5,8.4)
        =Density("argon";"TP";"SI";325,5;8,4)

验证Excel调用成功后,具体使用方法可以查看本贴附件“REFPROP.XLS”,包括使用的函数、单位等等,里面有说明。

再次感谢Mr.Bell,我只是个搬运工,希望对大家有用。
回复此楼

» 本帖附件资源列表

  • 欢迎监督和反馈:小木虫仅提供交流平台,不对该内容负责。
    本内容由用户自主发布,如果其内容涉及到知识产权问题,其责任在于用户本人,如对版权有异议,请联系邮箱:xiaomuchong@tal.com
  • 附件 1 : refprop.dll
  • 2018-01-07 01:00:23, 1.43 M
  • 附件 2 : REFPROP.XLS
  • 2018-01-07 01:00:24, 870 K
  • 附件 3 : REFPRP64.DLL
  • 2018-01-07 01:00:25, 2.58 M

» 猜你喜欢

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

huakelikun

金虫 (正式写手)


★★★★★ 五星级,优秀推荐

赞一个

[ 发自手机版 http://muchong.com/3g ]
2楼2018-01-07 21:00:15
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

xunda_wang

铁杆木虫 (小有名气)


★★★★★ 五星级,优秀推荐

楼主能否做一个具体的操作过程示范?
3楼2018-01-17 22:43:05
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

chenkping2005

金虫 (小有名气)


★★★ 三星级,支持鼓励

楼主能否发个示范学习学习,赞一个先
4楼2018-03-22 23:18:30
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

new_energy

新虫 (初入文坛)


试了一下,不行
5楼2018-08-29 16:06:18
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

喜欢3雨天

新虫 (初入文坛)


附件在哪里?
6楼2021-08-20 09:12:39
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
简单回复
2024-01-29 07:40   回复  
五星好评  顶一下,感谢分享!
2024-06-03 10:00   回复  
五星好评  顶一下,感谢分享!
相关版块跳转 我要订阅楼主 Marss 的主题更新
☆ 无星级 ★ 一星级 ★★★ 三星级 ★★★★★ 五星级
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 今天维护系统维护 祝所有人 高中 +8 gjjjzhong 2026-08-18 9/450 2026-08-18 13:01 by 家与远方
[基金申请] 欢迎发来filecode的Mz6后的代码验证其规律 +45 医学老男孩 2026-08-13 99/4950 2026-08-18 12:56 by dotnetchen9056
[硕博家园] 售SCI-T0P文章,我:8O.5.5.1.O.54,科目齐全,可+急 +3 KZyU1THERRVo 2026-08-18 3/150 2026-08-18 12:52 by vHWVV9D5Deb5
[基金申请] 哪位老哥知道今年的国自然具体哪一天放榜? +13 Ldrop2023 2026-08-13 16/800 2026-08-18 12:25 by 淀粉搬运工
[基金申请] 2027广东省杰青 +3 奶牛小黑 2026-08-15 8/400 2026-08-18 11:47 by gltch
[基金申请] 快农历七夕节了,轻松一下,男人悄悄话,女施主请不要进来。 +4 Tide man 2026-08-14 5/250 2026-08-18 11:35 by Tide man
[论文投稿] 投稿咨询 +4 wwm09 2026-08-17 5/250 2026-08-18 11:25 by 無關想念
[基金申请] 时间戳变了,能看出什么问题? +5 基诺咪客 2026-08-17 6/300 2026-08-18 11:06 by hunter无悔
[基金申请] 93BebMhtakh前后11位开头都是大写 +4 且听虎啸 2026-08-17 5/250 2026-08-18 00:49 by 蔡棒棒菂
[基金申请] 感觉是下周放榜了 +6 angus9576 2026-08-17 11/550 2026-08-17 23:57 by angus9576
[基金申请] filecode=后面第一个是大写字母 +8 wangze12014 2026-08-14 10/500 2026-08-17 17:05 by xter9665
[基金申请] 今天系统多次维护,明天很可能放榜! +8 zju2000 2026-08-16 9/450 2026-08-17 12:20 by lmz0216
[基金申请] 咱们一起用铁证分析2026国家社科基金中标与否 +7 启萌科技 2026-08-12 26/1300 2026-08-16 12:35 by 启萌科技
[基金申请] 各位道友,我要去昆明玩几天,回来见。 +7 Tide man 2026-08-14 8/400 2026-08-15 01:11 by arzu_hma
[基金申请] 是这周出结果还是下周出结果? +4 yuleib84 2026-08-11 4/200 2026-08-14 23:05 by lfy8008
[基金申请] 重要来源:本周末出结果 +10 瞬息宇宙 2026-08-12 10/500 2026-08-13 15:46 by likettle
[基金申请] 不应该看fileCode +7 且听虎啸 2026-08-12 9/450 2026-08-13 14:27 by flydreamws
[基金申请] Filecode 又变了,巨变 +3 WH3796 2026-08-12 4/200 2026-08-13 14:13 by 小木虫6752397
[基金申请] 结合人工智能,周易传统文化,filecode打分制来了,3分以上希望很大。 +3 Tide man 2026-08-12 4/200 2026-08-13 08:35 by ZJTJZ
[基金申请] 2019年青年基金涵评意见,大家看看几个A,几个B? +11 Tide man 2026-08-11 11/550 2026-08-13 07:35 by 撸猫猫
信息提示
请填处理意见