Jump to content

Featured Articles

Check out the latest featured articles.

File Library

Check out the latest downloads available in the File Library.

New Article

Product Viscosity vs. Shear

Featured File

Vertical Tank Selection

New Blog Entry

Low Flow in Pipes- posted in Ankur's blog


Macro Vba

6 replies to this topic
Share this topic:
| More

#1 CS10


    Veteran Member

  • Members
  • 30 posts

Posted 13 June 2017 - 11:51 PM

Dear Members,


I would like to get some good references of the Visual Basic Application to help me doing some of my day to day engineering works such as calculations and connect up Excel to Process Simulation (HYSYS).


I am new to this type of program (VBA), I want to get some more insight into this program especially supporting and make my works easily. I am working mostly related to process engineering works. 


This basically to understand the concept of Macro VBA in engineering works and using VBA to do the calculations as well as to export data from HYSYS to excel form. 


I would be appreciate,  if dear engineers and expertise can provide some guideline or references which i can use to improve my knowledge and skills in using this program.



Thank you





#2 christopherchoa


    Gold Member

  • Members
  • 63 posts

Posted 14 June 2017 - 02:55 AM

Hi D'Costa,


I learned to program VBA using the google search. More than the reference (books etc) are the websites/forums which have codes typed already. Just modify per line to suit your requirements.

#3 serra


    Gold Member

  • Members
  • 310 posts

Posted 14 June 2017 - 03:21 AM

simulators (normally) adopt automation to connect with Excel (you need to work within VBA editor and write some code),

VBA macros are (typically)  exported by thermodynamic libraries such as Prode Properties,

with VBA macros you can obtain calculated values directly in Excel cells,

for example, for speed of sound in two phase mixture (HEM method, in Prode) enter


= StrMSS(1)


there are other differences (between a thermodynamic  library and a full simulator),

for example the mechanism to start the provider, when you enter a macro in Excel

the add in (in our case the thermodynamic library) starts automatically and you see the results in Excel,

with external (independent) applications you may need to run and synchronize data,

of course you can write methods to wrap all the code required to access a simulator,

it depends from applications...


About the VBA examples, at cheresources.com there are several threads discussing how to link with Excel.

Edited by serra, 14 June 2017 - 03:51 AM.

#4 Bobby Strain

Bobby Strain

    Gold Member

  • Members
  • 3,529 posts

Posted 14 June 2017 - 09:11 AM

To learn, get the book by J. Walkenbach. Visit his site at j-walk.com. A used copy through Amazon is the best purchase. The AspenTech support site has examples that will get you familiar with the HYSYS object model. But you can plan to spend a couple years before you gain proficiency. To begin, you need to get the code from the support site. And learn the basics with the book. You will find that it is nothing like formulas in Excel, but much better.


Visit my website and you can download an application that uses HYSYS with Excel VBA. The code is not protected, so you can look at it and judge the challenge ahead.



Edited by Bobby Strain, 14 June 2017 - 09:17 AM.

#5 Ajay S. Satpute

Ajay S. Satpute

    Gold Member

  • Members
  • 177 posts

Posted 18 June 2017 - 09:14 AM

Hi Costa,


Below link might help you.






#6 CS10


    Veteran Member

  • Members
  • 30 posts

Posted 22 June 2017 - 02:04 AM

Dear All,


Thanks a lot for your comments and suggestions for my query.  I will definitely be using Mr. Google and this great engineering forum for my learning process in this program. 


Bobby: How can I download the application on you website. I have looked at you website but I cannot get the file mentioned.


Ajay: Thanks for this great files. Can I use those files (VBA code you have created) to link my HYSYS file to the Excel file?  


Many thanks to all

#7 Bobby Strain

Bobby Strain

    Gold Member

  • Members
  • 3,529 posts

Posted 22 June 2017 - 09:02 AM

Go to the downloads page. Read and follow the instructions.



Edited by Bobby Strain, 22 June 2017 - 09:03 AM.

Similar Topics