I want Microsoft Word to die. I hate Microsoft Word with a burning, fiery passion. Our reasons are, alarmingly, not dissimilar
Tweet Need to get stream data from your Aspen Hysys simulation into another format; say Microsoft Excel? It could be for a heat and material balance table, an equipment datasheet, or just data for a calculation.
Try one of the following approaches to copy out the Hysys data.
Except for tip 5, most of these approaches should work just as well for UniSim. For small amounts of data you can copy and paste directly out of Hysys windows. Create a workbook customized to show the data you want. Copy and paste into Excel. Crtl-shift-C works again Print the workbook instead of copying.
It is very easy to use and has instructions built right into the file.
At time of writing you would use HSR 1. Although unofficially, I have been told it is so popular they will likely be built for future versions of Hysys.
I find it very convenient, but there is a risk that for very large files or simulations you have to upgrade to new versions that something will go wrong.
Also, be aware that the program can be slow if you have a lot of stream data, and that it ties up both Excel and Hysys. You may want to test it by first writing a report with only a single stream property for all the streams of interest, to make sure that the connection to each stream is working correctly, before trying to get your full report out.
You can use the Spreadsheet unit operation. Create your own custom solution with Visual Basic programming to get data out of Hysys. You can also use it to pull data in, if you need to have Hysys interface to an external spreadsheet or program See if Aspen Simulation Workbookwhich helps you create linkages between Hysys and Excel, can help you Personally, I find Option 5 is the easiest, quite flexible and powerful.
Option 6 is a good choice if you only need a tiny handful of variables, but many different types of variables from different places in the simulation. Note that you could also use the spreadsheet approach to bring together the variables that you might want to change as you tune a program, as well as the variables you want to copy and paste to an outside program.
Option 7 is the most powerful but requires programming knowledge and work. The techniques in this post have been used with Hysys V7.This code opens ashio-midori.com in the ForWriting I/O mode, then uses the Write method to write the string to the file.
When you use the Write method, the TextStream object writes only the string you pass to it. This is another interesting point.
My (relatively limited) testing has shown that this was actually the slowest method of the three. Opening the files as a stream using the FSO took much more time than opening with an integer file handle, and it took about the same amount of .
From Excel VBA Programming For Dummies, 5th Edition. By John Walkenbach.
Microsoft Word is a tyrant of the imagination, a petty, unimaginative, inconsistent dictator that is ill-suited to any creative writer's use. Worse: it is a near-monopolist, dominating the word processing field. This code opens ashio-midori.com in the ForWriting I/O mode, then uses the Write method to write the string to the file. When you use the Write method, the TextStream object writes only the string you pass to it. This is an excellent book on three levels: 1. The book enables "New to VBA and even new to Excel" users to ramp up to proficiency quickly. 2. The book is laid out in a reference book manner so that if you need to go after a specific item you can do so quickly.
Excel shortcut keys allow you to perform certain tasks using only the keyboard. The idea being that you increase your efficiency when you limit the number of instances your hands have to move back and forth from the keyboard to the mouse.
This is an excellent book on three levels: 1. The book enables "New to VBA and even new to Excel" users to ramp up to proficiency quickly.
The book is laid out in a reference book manner so that if you need to go after a specific item you can do so quickly. You can also read Excel File and write the contents of the cell into a Text File using VBA. VBA allows the users to work with text files using two methods − File System Object; using Write Command; File System Object (FSO) As the name suggests, FSOs help the developers to work with drives, folders, and files.
How to create and write to a txt file using VBA. Ask Question. Dim oFs As New FileSystemObject Dim oFile As TextStream – TmTron Jun 16 '15 at How to create and write to a txt document from a batch executable. 1. Create and Write to a text file using an excel macro and VBA.