usnistgov / REFPROP-wrappers

Wrappers around NIST REFPROP for languages such as Python, MATLAB, etc.
191 stars 126 forks source link

Problem in starting Refprop 10.0 #349

Closed XiuzhongShen closed 3 years ago

XiuzhongShen commented 3 years ago

I am a user of REFPROP version 9.0. I bought REFPROP UPGRADE version 10 one year ago. I followed the installing process described in See the REFPROP FAQ for help installing and using REFPROP. It looks that I have finished installing REFPROP UPGRADE version 10. But I cannot use the Refprop version 10 in Excel and Matlab R2019b, even in the original REFPROP.XLS. My operating system and Version are Windows 10 Pro Version 1909. In order to solve this problem, recently I bought REFPROP version 10. I uninstalled the REFPROP UPGRADE version 10 and installed the REFPROP version 10. However, the problem still cannot be solved. I hope that a kind people can tell me a way to solve this problem?

ianhbell commented 3 years ago

Can you please fill out the template? We ask people to fill out out so that we have the necessary information to help you.

What is not working, and what error messages do you get?

XiuzhongShen commented 3 years ago

In sheet of Available Properties in REFPROP.XLS, "#VALUE!"( value error) appears in all cells that need to be calculated. The values are not shown correctly in that sheet.

XiuzhongShen commented 3 years ago

Please see the following photo of the sheet. REFPROP

ianhbell commented 3 years ago

Please start here: https://github.com/usnistgov/REFPROP-wrappers/issues/105

XiuzhongShen commented 3 years ago

Thank you very much for your comment. I have spent 2 days to study #105 and check Items 1-16 in Section 32 of "Resolving Problems Linking with Excel" and Section 33 of "Other Issues Related to the Use of Refprop in Excel" in "Answers to Frequently Asked Questions". I have made a lot tries to solve this problem. But the problem still persists now and it may be difficult for me solve this problem independently. Would you please log into my machine remotely to find the problem and the solution to the problem for me?

EricLemmon commented 3 years ago

OK, I'll contact you directly.

NickAtNight62 commented 3 years ago

Well, you have the expert (Eric) involved now.

I can't read the Chinese on the menu.

There should be a "REFPROP" tab added to the MENU. It does not seem to be there

Is the Menu addition on the screen?

Screenshot 2021-01-28 093055

NickAtNight62 commented 3 years ago

From the "Developer" tab

Screenshot 2021-01-28 093821

NickAtNight62 commented 3 years ago

The add-ins necessary to run the calculations are located in:
C:\Program Files (x86)\REFPROP

The file names are: REFPROP.XLA is the REFPROP AddIns PREFPROP_Ribbon.xlam is the REFPROP Ribbon

If the Ribbon is running, you should be able to run the "Wizard" (see picture)

Screenshot 2021-01-28 104734

With the default Wizard, Click the calculate button.

If that works, try the Compose button.

XiuzhongShen commented 3 years ago

Thank you very much for your help. There is no "Developer" and "REFPROP" in my EXCEL menu. I cannot find the Refprop AddIns through "file"->"Option"->"Addins". There is no "PI Wizard" near "Insert function" in the equation menu.

XiuzhongShen commented 3 years ago

Both of REFPROP.XLA and PREFPROP_Ribbon.xlam files exist in the fold of C:\Program Files (x86)\REFPROP. It looks that they do not work there since REFPROP Wizard does not appear in the EXCEL.

XiuzhongShen commented 3 years ago

2021-01-29

ianhbell commented 3 years ago

When go to the Addins panel, and Browse, can you browse to find the addin in the REFPROP folder?

XiuzhongShen commented 3 years ago

I have found the REFPROP AddIns in the REFPROP folder and added it just now. But the Excel file still does not work.

XiuzhongShen commented 3 years ago

I have added the excel AddIns of REFPROP AddIns and REFPROP Ribbon now. But the errors of #VALUE! do not disappear in the REFPROP.XLS.

NickAtNight62 commented 3 years ago

The "Developer" tab is not shown by default.

To turn it on:

  1. File
  2. Options
  3. Customize Ribbon
  4. Check the box for the developer tab.

Easier Alternative:

  1. In the gray area of any Ribbon,
  2. Right click.
  3. Select 'Customize the Ribbon' from the menu.

Screenshot 2021-01-28 205326

The Developer ribbon gives you these options.

Screenshot 2021-01-28 205443

In the Code area: ... If you ever want to automate some of your activities, You will probably find the 'Record Macro' feature a very useful getting started tool. Press 'record macro'... Press 'OK'. Perform the sequence of steps on your computer.... Press 'Stop recording'.

NickAtNight62 commented 3 years ago

It has been a long while since I installed REFPROP, but I believe that the two addins were added automatically when the program was installed. Perhaps Eric can refresh my memory.

Addins can be installed but not active. Make sure that the two files are checked.

There may be a security program disabling the addins and preventing them from running.

If not, you could start by looking in the 'Macro Security' section

For example, in "Trusted Locations" - I have the User Location C:\Program Files (x86)\REFPROP\ on my list. Note that there is also a check box at the bottom that allows me to 'Disable all Trusted location'

Screenshot 2021-01-28 211834

So if I turn some of those features off and restart... Well, that gives me a #name problem.

Screenshot 2021-01-28 212504

XiuzhongShen commented 3 years ago

Thank you (Ian and Nick) very much. Eric has helped me to turn on the "REFPROP" tab remotely. Following the comment of Nick, I have turned on the "Developer" tab. But in the REFPROP Wizard, I still cannot obtain the air density of 1.276 kg/m3). The error message is "#Make sure the REFPROP.XLA add-in is enabled to calculate items in the cells." Actually, I have enabled REFPROP add-in. Because it was too late today, Eric will help me to solve the remaining problem tomorrow. I really appreciate your kind help.

2021-01-29 (4)

NickAtNight62 commented 3 years ago

Excellent.

So one of the addin's is now working. So now we are just down to an issue with the refprop.xla addin. You are 1/2 way home. What did you have to do to 'turn on the REFPROP tab'? Tnat may be instructive as to why the other addin is not working.

The correct answer is 'Wait for Eric' !

But just in the spirit of learning, what would we check next?

From the Developer Tab, in the Code section - Click on 'Visual Basic'.

In the Project - VBAProject window on the left ... there should be a list of all open projects. - There are 2 related to REFPROP

  1. REFPROPExcelSpreadsheet (REFPROP.XLA)
  2. REFPROP_RIBBON (REFPROP_Ribbon.xlam)

So take a look at the one that is not working (REFPROPExcelSpreadsheet)

Hmmm. Check it out, the very first two lines give you the following comment.

'If a #VALUE message appears in your worksheets, EXCEL may not have connected with the DLL. In this situation, you can either add the location of the REFPROP program ' to your path statement (in the environment variables), or you can change "REFPROP.DLL" in the lines below to something like "c:\Program Files (x86)\REFPROP\REFPROP.DLL"

So I think that is what needs to be fixed. Your program is not finding the "REFPROP.DLL" file.

NickAtNight62 commented 3 years ago

A side task. Write your first VBA Macro - {Visual Basic for Applications}

  1. Developer tab
  2. Record Macro
  3. Complete the Record Macro Box.
    • Enter your Macro name: "MyFirstMacro"
    • Enter your Shortcut key: Ctrl+ "q"
    • Store macro in: "This Workbook"
    • Description: "This is my first macro. I made it by Recording a sequence of steps using the Record Macro button"

Perform the actions you want to record. Press "Stop Recording"

For this example, just enter the numbers 1 to 10... one number on each row.

1 2 3 4 5 6 7 8 9 10

To run your Macro, press Ctrl + q

Erase the spreadsheet. Run the Macro again.

Erase the spreadsheet. Press the Macro button. That will show you a list of all of your Macros. "MyFirstMacro" should be the only one on the list.

Select the Macro you want to run from the list, Press the RUN button to run from this list.

If you want to add it to your ribbon...

Right click on any ribbon - Customize Ribbon

Screenshot 2021-01-29 143048

Now you have a button you can press to run the Macro.

Go to Developer Select Visual Basic Find your workbook (VBAProject (Book1)) Modules Module 1

Here is the code you wrote:

Sub MyFirstMacro() ' ' MyFirstMacro Macro ' This is my first macro. I made it by Recording a sequence of steps using the Record Macro button ' ' Keyboard Shortcut: Ctrl+q ' ActiveCell.FormulaR1C1 = "1" Range("B4").Select ActiveCell.FormulaR1C1 = "2" Range("B5").Select ActiveCell.FormulaR1C1 = "3" Range("B6").Select ActiveCell.FormulaR1C1 = "4" Range("B7").Select ActiveCell.FormulaR1C1 = "5" Range("B8").Select ActiveCell.FormulaR1C1 = "6" Range("B9").Select ActiveCell.FormulaR1C1 = "7" Range("B10").Select ActiveCell.FormulaR1C1 = "8" Range("B11").Select ActiveCell.FormulaR1C1 = "9" Range("B12").Select ActiveCell.FormulaR1C1 = "10" Range("B13").Select End Sub

Now you can manually edit it to make it do something different, or fix any mistakes you made.

XiuzhongShen commented 3 years ago

Thank you (Nick) very much. My problem has been solved completely by following your comment. My REFPROP.XLS can work properly now as follows. I have practiced writing my first VBA Macro by following your side task. I have successfully finished the side task. I really appreciate the time and effort of your 3 experts (Eric, Ian and Nick) in helping fixing my problem.

2021-01-30 (2)

NickAtNight62 commented 3 years ago

Excellent news. Glad to be of help.

There are lots of excellent tutorials on how to use VBA with Excel. https://www.guru99.com/vba-tutorial.html

XiuzhongShen commented 3 years ago

Thank you (Nick) for your kind help. The VBA with Excel will be an important tool in my future research.