0% found this document useful (0 votes)
130 views10 pages

27 Excel Add-Ins

Uploaded by

gore_11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
130 views10 pages

27 Excel Add-Ins

Uploaded by

gore_11
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

HSC Chemistry

6.0 27 - 1
Peter Bjorklund August 10 2006 06120-!"C-#
27. $%&el Add-'n (un&tions
27.1 )etting st*rted
With HSC 6.0 Add-In Functions it is possible to use the HSC 6.0 database directly under
MS Excel 000 and in that !ay carry out se"eral ther#oche#ical calculations. In order to
use these $unctions in Excel they #ust% ho!e"er% $irst be acti"ated. &hree sta'es #ay be
needed to acti"ate HSC $unctions in Excel. &he nu#ber o$ sta'es needed depends on the
co#puter settin's and Windo!s and Excel "ersions.
A&ti+*tion St*ge 1,
1. (pen Excel 000 )*(&E+ HSC Add-Ins may not work under earlier Excel versions!,
2. Select -#ools Add-'ns.... $ro# the #enu.
/. Select -Bro0se1. and locate HSC6.233 $ro# your HSC64Add'ns $older.
5. Select -HSC 6.0 (un&tions. and press -!6.% see Fi'ure -. It #ay be necessary to
restart Excel in order $or the add-in $unctions to !or..
(igure 1, Adding/removing HSC 6.0 Functions under Excel Please do NOT select old
HSC 5.1 Functions!.
A&ti+*tion St*ge 2 7!8tion*l9,
I$ the installation is unsuccess$ul% the $ollo!in' steps #ay help+
1. Start the /0A Editor by pressin' Alt1F--.
)or select &ools% Macro% /isual 0asic Editor% ...,
2. Select -#ools "e:eren&es. $ro# the #enu.
/. Select -Bro0se1. and locate HSC6.233 $ro# your HSC directory )$or exa#ple
C+2HSC62HSC6.344,. It #ay be necessary to restart Excel in order $or the add-in
$unctions to !or.. HSC Add-In $unctions locate in HSC6.544% ho!e"er% Excel calls
these $unctions throu'h HSC6.344 inter$ace.
6. See also sta'e 7 in Chapter 8. i$ needed.
&he HSC installation routine auto#atically ta.es care o$ the HSC6.544 re'istration.

HSC Chemistry

6.0 27 - 2
Peter Bjorklund August 10 2006 06120-!"C-#
A&ti+*tion St*ge / 7!8tion*l9,
1. 5urin' openin'% ans!er ;o !hen pro#pted by Excel to update all lin.ed
in$or#ation )auto#atic lin. updates do not !or. due to so#e bu' in MS Excel,.
2. Select 9$dit 3inks: $ro# the #enu.
/. Choose the path containin' HSC6.233 $ro# the listbox and press 9Ch*nge
Sour&e..
5. 0ro!se to your HSC64Add'ns $older and choose HSC6.233.
27.2 <8d*ting 23S-(iles 0hi&h use old HSC =.1 Add-'n (un&tions
(igure 2, Update XLS Files.xls macro ma !e used to update old Excel "iles #it$ HSC
%.& Add'(n "unctions to HSC 6.0 Add'(ns.
;ou #ust update old Excel $iles !ith HSC <.- Add-In $unctions. I$ you $ind $ollo!in'
type $or#ulas $ro# your Excel spreadsheet then you #ust update+
=>C+2HSC<2AddIns?0ac.@p2HSC<.xla>AH)5--BE--,
HSC <.- use old HSC<.34A inter$ace% HSC 6.0 Add-Ins use better HSC6.344 inter$ace
!hich #a.es the use o$ these $iles #uch #ore easier because the path to the HSC6.344
$iles is not sa"ed into the 34S-$ile cellsA

HSC Chemistry

6.0 27 - /
Peter Bjorklund August 10 2006 06120-!"C-#
27./ Brie: >es&ri8tion o: the (un&tions
&he C AddInSa#ple.xlsC sa#ple $ile o$$ers the $astest !ay to start usin' HSC 6 Add-In
$unctions% you #ay $ound it $ro# HSC 6 $older% such as+
C+2HSC62AddIns2AddInSa#ple.xls
&he add-in $unctions are used the sa#e !ay as $unctions in 'eneral under MS Excel. For
exa#ple by !ritin' -?H7A1@A29. the enthalpy $or the species in cell A- and at the
te#perature in cell A% is returned. &o "ie! all existin' $unctions si#ply select -'nsert
(un&tion. $ro# the #ain #enu and then choose -<ser >e:ined. $ro# the le$t listbox.
&he ri'ht listbox !ill no! 'i"e sho! all a"ailable HSC $unctions and their ar'u#ents. A
co#plete description o$ the $unctions is 'i"en in the $ollo!in' tables - and .
A use$ul Excel exa#ple $ile is located in the catalo'ue 92AddIns: in your HSC
installation directory. &he exa#ple% called 9AddInSa#ple.xls:% can be "ie!ed a$ter the
add-ins ha"e been #ade a"ailable )described in Chapter 8.-,. Fi'ure 7 sho!s !hat the
exa#ple $ile should loo. li.e usin' MS Excel 000.
&he $unctions are all collected in the colu#n 9Function: and their return "alues under
9Deturn "alue:. A red $ont indicates the input "alues !ith a short description o$ e"ery
$unction sho!n to the ri'ht. &his exa#ple pro"ides an easy #ethod $or testin' the
$unctions and also pro"ides practice in learnin' ho! to use the#.

HSC Chemistry

6.0 27 - 5
Peter Bjorklund August 10 2006 06120-!"C-#
HSC Add-'n (un&tions - S8e&ies B*sed
(un&tions >es&ri8tions 7"eturn +*lues9
)ener*l >es&ri8tion 7"eturn +*lue9,
<;'#S7#@$9 Chan'es the te#perature and ener'y units
BA37$Au*tion9 0alanced reaction eEuation
SP$C'$S7>B;oPosition9 Species $or#ula in 'i"en database and record nu#ber
S8e&ies >es&ri8tion 7"eturn +*lue9,
H7S8e&ies@#9 Enthalpy )per .#ol, o$ species at 'i"en te#perature
H6)7S8e&ies@#9 Enthalpy )per .', o$ species at 'i"en te#perature
H;B/ or HCB7S8e&ies@#9 Enthalpy )per *#F, o$ species at 'i"en te#perature
H3A#7S8e&ies@#9 Enthalpy excludin' phase trans$or#ations )per #ol, o$ species at 'i"en
te#perature
S7S8e&ies@#9 Entropy )per M#ol, o$ species at 'i"en te#perature
CP7S8e&ies@#9 Heat capacity )per M#ol, o$ species at 'i"en te#perature
)7S8e&ies@#9 Gibbs ener'y )per .#ol, o$ species at 'i"en te#perature
"e*&tion eAu*tion >es&ri8tion 7"eturn +*lue9,
H7$Au*tion@#9 Enthalpy di$$erence )per .#ol, o$ reaction eEuation at 'i"en te#perature.
H6)7$Au*tion@#9 Enthalpy di$$erence )per .', o$ reaction eEuation at 'i"en te#perature
S7$Au*tion@#9 Entropy di$$erence )per M#ol, o$ reaction eEuation at 'i"en te#perature
CP7$Au*tion@#9 Heat capacity di$$erence )per M#ol, o$ reaction eEuation at 'i"en te#perature
)7$Au*tion@#9 Gibbs ener'y di$$erence )per .#ol, o$ reaction eEuation at 'i"en te#perature
67$Au*tion@#9 EEuilibriu# constant o$ reaction eEuation at 'i"en te#perature
'ter*tion 7re+erse9 >es&ri8tion 7"eturn +*lue9,
#A#H7S8e&ies@H9 &e#perature o$ species at 'i"en enthalpy )per .#ol,
#A#H6)7S8e&ies@H9 &e#perature o$ species at 'i"en enthalpy )per .',
#A#H;B/ or #A#HCB7S8e&ies@H9 &e#perature o$ species at 'i"en enthalpy )per *#7,
#A#H3A#7S8e&ies@H9 &e#perature o$ species )per .#ol, at 'i"en enthalpy excludin' phase
trans$or#ations
#A#S7S8e&ies@S9 &e#perature o$ species at 'i"en entropy )per M#ol,.
#A#CP7S8e&ies@CP9 &e#perature o$ species at 'i"en heat capacity )per M#ol,
#A#)7S8e&ies@)9 &e#perature o$ species at 'i"en Gibbs ener'y )per .#ol,
#em8. inde8endent >es&ri8tion 7"eturn +*lue9,
S#"<C#7S8e&ies9 Structural $or#ula o$ 'i"en species
CH;AB$7S8e&ies9 Che#ical na#e o$ 'i"en species
C!;AB$7S8e&ies9 Co##on na#e o$ 'i"en species
CA;7S8e&ies9 Che#ical abstract nu#ber o$ 'i"en species
BC7S8e&ies9 Molecular !ei'ht o$ 'i"en species H.'I.#olJ
>$7S8e&ies9 5ensity o$ 'i"en species H.'IlJ
BP7S8e&ies9 Meltin' point o$ 'i"en species
BP7S8e&ies9 0oilin' point o$ 'i"en species
PHAS$7S8e&ies9 Khase type o$ 'i"en species
")BC!3!"7S8e&ies9 DG0 color code o$ 'i"en species
"$(7S8e&ies9 De$erence o$ 'i"en species
"$37S8e&ies9 Deliability class o$ 'i"en species
Per&ent*ge >es&ri8tion 7"eturn +*lue9,
B!3P7S8e&ies1@S8e&ies29 Species - content in Species in #ol-L
C#P7S8e&ies1@S8e&ies29 Species - content in Species in !t-L
CP-:un&tion rel*ted >es&ri8tion 7"eturn +*lue9,
CP(<;C#'!;7S8e&ies9 Heat capacity )Cp, polyno#ial $unction o$ 'i"en species
CPA7S8e&ies9 A coe$$icient in Cp-$unction o$ 'i"en species
CPB7S8e&ies9 0 coe$$icient in Cp-$unction o$ 'i"en species
CPC7S8e&ies9 C coe$$icient in Cp-$unction o$ 'i"en species
CP>7S8e&ies9 5 coe$$icient in Cp-$unction o$ 'i"en species
#B';7S8e&ies9 4o!er li#it o$ Cp-$unction te#perature ran'e
#BA27S8e&ies9 @pper li#it o$ Cp-$unction te#perature ran'e
#*Dle 1, )escription o" all currentl availa!le HSC Species !ased add'in "unctions.

HSC Chemistry

6.0 27 - =
Peter Bjorklund August 10 2006 06120-!"C-#
HSC Add-'n (un&tions - Stre*m B*sed
(un&tions >es&ri8tions 7"eturn +*lues9
Stre*mE(lo0 >es&ri8tion 7"eturn +*lue9,
S#"$ABH7S8e&ies@Amount@#9 Enthalpy o$ the speci$ied strea#I$lo! )species in .#ol, at 'i"en te#perature
(3!CH7S8e&ies@Amount@#9
S#"$ABH6)7S8e&ies@Amount@#9 Enthalpy o$ the speci$ied strea#I$lo! )species in .', at 'i"en te#perature
(3!CH6)7S8e&ies@Amount@#9
S#"$ABH;B/7S8e&ies@Amount@#9 Enthalpy o$ the speci$ied strea#I$lo! )species in *#7, at 'i"en te#perature
(3!CH;B/7S8e&ies@Amount@#9
S#"$ABH3A#7S8e&ies@Amount@#9 Enthalpy excludin' phase trans$or#ations o$ the speci$ied strea#I$lo! )species
in .#ol, at 'i"en te#perature
(3!CH3A#7S8e&ies@Amount@#9
S#"$ABS7S8e&ies@Amount@#9 Entropy o$ speci$ied strea#I$lo! )species in M#ol, at 'i"en te#perature
(3!CS7S8e&ies@Amount@#9
S#"$ABCP7S8e&ies@Amount@#9 Heat capacity o$ speci$ied strea#I$lo! )species in M#ol, at 'i"en te#perature
(3!CCP7S8e&ies@Amount@#9
S#"$AB)7S8e&ies@Amount@#9 Gibbs ener'y o$ speci$ied strea#I$lo! )species in .#ol, at 'i"en te#perature
(3!C)7S8e&ies@Amount@#9
>ensityA7S8e&ies@Amount@#9 5ensity o$ aEueous solution ).'I#7,
Ar'. = Wei'ht $ractions% #ax = -% Ar'. 7 = te#perature MC
Stre*mE(lo0 iter*tion 7re+erse9 >es&ri8tion 7"eturn +*lue9,
S#"$AB#H7S8e&ies@Amount@H@#min@#B*%9 &e#perature o$ strea#I$lo! )species in .#ol, at 'i"en enthalpy bet!een &#in
and &#ax
(3!C#H7S8e&ies@Amount@H@#min@#B*%9 (utside ran'e returns N/A4@EA
S#"$AB#H6)7S8e&ies@Amount@H@#Bin@#B*%9 &e#perature o$ strea#I$lo! )species in .', at 'i"en enthalpy bet!een &#in and
&#ax
(3!C#H6)7S8e&ies@Amount@H@#min@#B*%9 (utside ran'e returns N/A4@EA
S#"$AB#H;B/7S8e&ies@Amount@H@#min@#B*%9 &e#perature o$ strea#I$lo! )species in *#7, at 'i"en enthalpy bet!een &#in
and &#ax
(3!C#H;B/7S8e&ies@Amount@H@#min@#B*%9 (utside ran'e returns N/A4@EA
S#"$AB#H3A#7S8e&ies@Amount@H@#min@#B*%9 &e#perature o$ strea#I$lo! )species in .#ol, at 'i"en enthalpy excludin' phase
trans$or#ations bet!een &#in and &#ax
(3!C#H3A#7S8e&ies@Amount@H@#min@#B*%9 (utside ran'e returns N/A4@EA
S#"$AB#S7S8e&ies@Amount@S@#min@#B*%9 &e#perature o$ strea#I$lo! )species in M#ol, at 'i"en entropy bet!een &#in
and &#ax
(3!C#S7S8e&ies@Amount@S@#min@#B*%9 (utside ran'e returns N/A4@EA
S#"$AB#CP7S8e&ies@Amount@CP@#min@#B*%9 &e#perature o$ strea#I$lo! )species in M#ol, at 'i"en heat capacity bet!een
&#in and &#ax
(3!C#H7S8e&ies@Amount@H@#min@#B*%9 (utside ran'e returns N/A4@EA
S#"$AB#)7S8e&ies@Amount@)@#min@#B*%9 &e#perature o$ strea#I$lo! )species in .#ol, at 'i"en 'ibbs ener'y bet!een
&#in and &#ax
(3!C#)7S8e&ies@Amount@)@#min@#B*%9 (utside ran'e returns N/A4@EA
$AuiliDrium Com8ositions >es&ri8tion 7"eturn +*lue9,
Stre*m$F7S8e&ies@'n8ut@!ut8ut # P9 EEulibriu# a#ounts o$ species based on 'i"en a#ounts% te#perature and
pressure.
#*Dle 2, )escription o" all currentl availa!le HSC Stream !ased add'in "unctions.

HSC Chemistry

6.0 27 - 6
Peter Bjorklund August 10 2006 06120-!"C-#
(igure /, Example including all availa!le Excel add'in "unctions *Add(nSample.xls+.

HSC Chemistry

6.0 27 - 7
Peter Bjorklund August 10 2006 06120-!"C-#
27.5 Stre*m $AuiliDrium (un&tion 7Arr*y (un&tions9
&he array $unctions are created in di$$erent !ay than nor#al spreadsheet $unctions. &he
#ost i#portant array $unction o$ HSC-Si# is Stre*m$F !hich calculates the a#ounts
o$ species in the eEuilibriu# state at 'i"en te#perature and pressure.
(ig. 5. Selection $or array $unction.
;ou #ay create array $unction in MS Excel and HSC-Si# usin' the sa#e procedure+
1. Create continuos list o$ phases and species in one colu#n. I#portant+ &he phase
na#e strin' #ust al!ays start !ith G-character% Fi'. 6.
2. Speci$y te#peratures o$ the phases into the next colu#n on the O-phase-ro!.
/. Speci$y the input a#ounts )#oles, o$ the species into the next colu#n.
5. Select array $unction cell ran'e% see Fi'. 6.
=. &ype array $unction+ =Strea#EP)A6+A-<B06+0-<BC-BC,% Fi'. <.
6. Qeep Crtl 1 Shi$t .eys do!n and press Enter% Fi'. 6.
7. &he array $unction is ready i$ it is !ithin brac.ets% Fi'. 6.
Klease note that the array $unction cell ran'e #ust be continuous% it is li.e a solid and
$ixed bloc. !ithin spreadsheet. 5o not bra.e o$$ this cell ran'e !ith uncontinuous copy-
paste% insert ro!s% delete ro!s% etc. operations.

HSC Chemistry

6.0 27 - H
Peter Bjorklund August 10 2006 06120-!"C-#
(ig. =. &ype array $unction.
(ig. 6. Qeep Crtl 1 Shi$t .eys do!n and press Enter.

HSC Chemistry

6.0 27 - I
Peter Bjorklund August 10 2006 06120-!"C-#
27.= HSC Add'n (un&tions
So#e o$ the AddIn $unctions are a"ailable on in HSC Che#istry streadsheets but not in
MS Excel. Currently the Strea#3 is such a $unction+
Function Stre*m2
Syntax Strea#3)Stre#*a#eBKarticlesDan'eB/ariable,
Exa#ples Strea#3)ER6BRER<6+RERS8BR0T,
Strea#3)9D(M:BRER<6+RERS8B:Si(:,
Explanation Deturns the "alue o$ the "ariable% e.'. Si( content o$ the strea#
calculated accordin' to particles. *ote that particle data can be corrected
to be in har#ony !ith che#ical and #ineral co#position o$ the bul.
$eed.
Applications Strea#3 $unctions is used in Mineral 0ased Models
(ther HSC AddIn $unctions are Strea#3% "e&o+ery2 P*rti&le"e&2 (r*&tion2
Biner*l2. &hese are described in #ore details in chapter C<8. Mineral 0ased ModelsC.

HSC Chemistry

6.0 27 - 10
Peter Bjorklund August 10 2006 06120-!"C-#
27.6 Bore *Dout registering >33 (iles
&he HSC 6.0 installation routine should ta.e care o$ all necessary 544 re'istrations.
When selectin'Ideselectin' the HSC 6.0 add-in usin' Excel% HSC6.544 is auto#atically
re'isteredIunre'istered. Ho!e"er% it is also possible to re'isterIunre'ister the HSC6.544
$ile #anually. &he pro'ra# to achie"e this is called De's"r7.exe
U,
and re'istration is
co#pleted usin' the $ollo!in' #ethod+
*ote+ For other HSC6 installation paths than C+2HSC6% si#ply use your path instead in
the instuctions belo!.
1. Select -St*rt "un.... $ro# the Windo!s #enu.
2. &ype -regs+r/2 C,4HSC64HSC6.dll. $or re'isterin' HSC 6.0 add-in $unctions.
Alternati"ely it can be achie"ed usin' the $ollo!in' #ethod+
1. 5ouble-clic. the $ile -HSC6.>33. in your HSC directory.
2. I$ the $ile is not re'istered auto#atically% !hich is indicated by an -!8en Cith.-
dialo' box% choose -!ther1. in the dialo' !indo!.
/. Select -"egs+r/2.e%e. $ro# your Windo!s Syste# directory. *o! double-clic. the
$ile a'ain and it should re'ister auto#atically.
When unre'isterin' $iles $ollo! the sa#e procedure% but add the Eu s!itch be$ore the $ile
na#e% i.e. -regs+r/2 Eu C,4HSC64HSC6.>33. $or unre'isterin' HSC6.dll.
J>es&ri8tion o: "egs+r/2.e%e
&o add .ocx and certain .dll $iles% it !ill be necessary to run DEGS/D7.E3E $ro# the
Dun option in the Start #enu. &he $ollo!in' are the co##ands and s!itches needed+
regsvr,- HIuJ HIsJ HnJ Hi H+c#dlineJJ dll name or ocx name
Iu )unre'istered ser"er,
Is )silentB display no #essa'e boxes,
Ic )console output,
Ii Call dll or ocx install passin' it an optional Hc#dlineJB
!hen used !ith Iu calls dll or ocx uninstall
In 5o not call dll De'isterSer"erB this option #ust be used !ith II

You might also like