Input Easy Output Easier

You now know everything that you neei to know to learn how to collect worksheet-based input and display output. Worksheet-based input/output (I/O) draws on your knowledge of using the Application,

Workbook, Worksheet, and Range objects. Sure, the direct object you use is the Value property of the Range object, but you can't effectively and professionally do this without using all of the other objects I mentioned.

One of the reasons you need to draw on your knowledge of all of the objects we have covered so far is that I/O is a risky operation in terms of the potential for run-time errors and you need to program accordingly.

The other reason is that without giving some thought to I/O, it's easy to create rigid procedures that are error prone and hard to maintain. In order to avoid this problem, you should think about how your procedures handle I/O and what you can do to create reasonably flexible procedures that are easy to maintain.

In any event, you'll need to make certain assumptions regarding I/O, and you need to safeguard or enforce those assumptions to eliminate or significantly reduce the potential for run-time errors. This could be as simple as telling your users to modify the workbook structure at their own risk. On the other end of the spectrum, you could develop a complex workbook and worksheet protection scheme that only allows changes that are necessary to accomplish the objectives that the workbook was designed to accomplish. Ultimately, the choice comes down to a tradeoff between development time on the one hand, and the utility of increased flexibility and application robustness on the other. That said, let's see if I can highlight some of these tradeoffs as you explore some of the ways that you can perform I/O in Excel.

0 0

Post a comment