PDA

View Full Version : Preserving Objects and Collections



clew
06-16-2010, 08:29 AM
Hello. I've done a little VBA Excel, but am just getting into using custom classes and collection classes. The project I'm working uses forms and other UI to let the user "build" a system. To do this, I'm creating custom classes to represent the components of the system the user adds and to hold other information about the components.

My question is, how can I preserve the data entered by the user, once it is stored as variables in my object model? As of now, once the workbook is closed, all my variables are lost. I've read about scope and lifetime of variables. How can I preserve this user-defined data from session to session? Will it require writing to a worksheet or text file? This would mean devising a whole schema for writing and reading to text.

Thank you.

Bob Phillips
06-16-2010, 08:51 AM
You would have to write out all of the properties of the class somewhere, either a worksheet in the workbook, in defined names, in a text file, or in the registry. A lot of work.