Forum Discussion
Enrique_Garcia_Franco
Apr 06, 2021Copper Contributor
Exporting mathematical model in Excel into a script
Dear Community: I have been using Excel for modelling Chemical Process Engineering since a while ago. I find it convenient, as it is visual, easily portable and easily accessible. I was wond...
- Apr 13, 2021Formula from Excel to text file is possible to be exported/copied using VBA macro. VBA works like other programming languages,, has enough capacity also. You need to work in either way ,, read value from sheet or input through User Form,,, ultimately it needs values to be calculated.
Enrique_Garcia_Franco
Apr 11, 2021Copper Contributor
Rajesh:
Thank you for your answer.
Indeed, I could try solving it in Excel.
The goal is to make the solver value minimal (tending to zero).
However, my goal is to export the equations into a script.
mass = vapor + liquid
Vapor/MW * R * T = P * V_vapor
...
Do you have any comments with these regards?
I would appreciate it.
Have a good day.
Thank you.
Rajesh_Sinha
Apr 12, 2021Iron Contributor
Since Excel uses only cell reference then either you may use cell references or NAME assigned to the cell while using the Formula.
And in case of Excel VBA macro R, T & P should be Variables.
And in case of Excel VBA macro R, T & P should be Variables.
- Enrique_Garcia_FrancoApr 12, 2021Copper ContributorThank you.
And how could I export all formulas into a text file?
It is a matter of VBA reading cell by cell and copying what has been typed, I guess.
Thank you.
Regards.- Rajesh_SinhaApr 13, 2021Iron ContributorFormula from Excel to text file is possible to be exported/copied using VBA macro. VBA works like other programming languages,, has enough capacity also. You need to work in either way ,, read value from sheet or input through User Form,,, ultimately it needs values to be calculated.
- Enrique_Garcia_FrancoApr 13, 2021Copper ContributorGreat. Thank you so much, Rajesh-S.
I shall do so.
I have marked your answer as the best.
Have a good week!