–Geoff-Hart.com:–Editing, Writing, and Translation —Home —Services —Books —Articles —Resources —Fiction —Contact me —Français |
You are here: Resources --> 2001 -->
Using VBA to prototype a software interface
Vous êtes ici : Ressources --> 2001 --> Using
VBA to prototype a software interface
by Geoff Hart
Previously published as: Hart, G. 2001. Using VBA to prototype a software interface. http://soltys.ca/techcomm/articles/Using_VBA_to_Prototype_a_Software_Interface.html
In general, most of us get good screen captures of real applications using tools such as SnagIt. However, there are occasional situations in which it would be helpful to create your own dialog box. Sometimes the dialog or window already exists in the software you're documenting, but is difficult to capture properly (e.g., because of unsuitable magnification or poor choice of text vs. background colors); sometimes you want to present a quick prototype to developers to illustrate a suggested interface improvement; and sometimes you need to create something entirely fictitious to illustrate a point. (That's the source of this article, by the way; I'm writing a chapter in an upcoming textbook and needed to mock up some illustrative screenshots to match an example I described.) Last but not least, we occasionally see conversations on the techwr–l mailing list that lead up to a recommendation that the techwhirler create a mockup of the screen in Corel or another graphics program.
Although you could certainly plead with the developers to use their interface design tools to mock up the dialog box for you, you can also do the work yourself if you have access to a copy of most Microsoft Office applications, such as Microsoft Word, Microsoft Excel, or Powerpoint. (Other software may offer similar features.) These applications include Visual Basic for Applications (VBA), which includes all the tools that you need to develop an interface.
Trust me, this is easier than it looks from the description. For this article, we'll use Excel. With a new document open in Excel:
Voila! Instant, professional-looking dialog box.
To display the dialog box so you can grab it with your screen capture software:
Sub test()
UserForm1.Show
End Sub
Thanks to my colleague Marc Arsenault for revealing this tip and providing the VBE expertise to write the macro.
©2004–2024 Geoffrey Hart. All rights reserved.