This post is requested by Mayembe. He asked me to post a VBA code in Excel to access Hysys splitter.
Here is the VBA example
=================================================
' VBA code starts here
Option Explicit
Public hyApp As HYSYS.Application
Public simCase As SimulationCase
Public tee1 As TeeOp
Public Sub StartHYSYS()
Dim filename As String
Dim ratio As Variant
' LOADING HYSYS SIMULATION FILE
Set hyApp = CreateObject("HYSYS.Application")
hyApp.Visible = True
Set simCase = hyApp.ActiveDocument
If simCase Is Nothing Then
filename = Worksheets("Sheet1").Range("c4")
If filename <> "False" And simCase Is Nothing Then
Set simCase = GetObject(filename, "HYSYS.SimulationCase")
simCase.Visible = True
End If
End If
Set tee1 = simCase.Flowsheet.Operations("teeop").Item("tee-101")
ratio = tee1.SplitsValue
ratio(0) = Worksheets("Sheet1").Range("c5").Value
ratio(1) = Worksheets("Sheet1").Range("c6").Value
tee1.Splits.SetValues ratio, ""
End Sub
'this is the end of VBA code
=====================================
Just for your note, "TEEOP" is a operation code name for "TEE" or splitter in Hysys.
And here is the excel interface. I use previous example of hysys file to develop our model. If you forget about our previous hysys model, check previous example
Let me know that you have comment or request. We'll see what I can do. I hope.
Alex
Hi Alex,
ReplyDeleteIt has been a while since I last visited your blog.
Thank you for posting the code for the splitter.
Mayembe
Hi Alex,
ReplyDeletecan u help me to read the content of Notes tab present in any material stream or operation through vba excel.
I tried a lot but not able to find any help on this topic.
This comment has been removed by the author.
ReplyDeleteHi, great blog.
ReplyDeleteThere is any way to get a VB code for each equipment in hysys, to make custom operations? I want to make a separator, but including the code to size a vertical vessel with semielliptical or semicircle heads.
Thanks.
Hi
ReplyDeleteThank you for your posting
i have one question.
Can i change the binary parameter using VBA?
when i choose the "PRSV" as a property PKG.
then input kij and kji for calculation of binary interaction.
kij and kji are constant but, in paper, there are function of temperature
for example, kij = cij + dij*T(K)
So, i want input the binary parameter as function of temperature.
How can i do?
pleases let me know.
Thanks
Hi, thank you for your code. Actually I tried to implement it in order to send data from VBA to Hysys to change the ratio of the splitter from the excel sheet, but unfortunately it's not working. It doesn't accept this syntax : tee1.Splits.SetValues ratio, "" Can I write it differently ?? Thank you very much
ReplyDeleteDiyarbakır
ReplyDeleteKırklareli
Kastamonu
Siirt
Diyarbakır
XU5SXZ
Eskişehir
ReplyDeleteDenizli
Malatya
Diyarbakır
Kocaeli
GWUD
adıyaman
ReplyDeletesakarya
yalova
tekirdağ
amasya
W615
E9C0F
ReplyDeleteÇerkezköy Kurtarıcı
Malatya Şehir İçi Nakliyat
Tekirdağ Boya Ustası
Ünye Mutfak Dolabı
Bitexen Güvenilir mi
Balıkesir Evden Eve Nakliyat
Niğde Parça Eşya Taşıma
Burdur Evden Eve Nakliyat
Afyon Evden Eve Nakliyat
C7F8E
ReplyDeleteBursa Parça Eşya Taşıma
Altındağ Fayans Ustası
Tokat Şehir İçi Nakliyat
Trabzon Şehir İçi Nakliyat
Malatya Parça Eşya Taşıma
Amasya Şehir İçi Nakliyat
Balıkesir Evden Eve Nakliyat
Giresun Şehir İçi Nakliyat
Antep Evden Eve Nakliyat
1CB17
ReplyDeleteMilyon Coin Hangi Borsada
Clubhouse Takipçi Satın Al
Tiktok Beğeni Satın Al
Görüntülü Sohbet
Bonk Coin Hangi Borsada
Bitcoin Kazanma Siteleri
Görüntülü Sohbet Parasız
Mexc Borsası Güvenilir mi
Bitcoin Nedir
061796FDAA
ReplyDeleteinstagram türk takipçi