VBA

VBA (Visual Basic® for Applications) is the common integrated development language used by the Microsoft® Office programs. VBA enables one Microsoft Office application to control another. So for example, VBA code running in Excel® could start up Word, open a document, add something to the document and save it and then close Word. Similarly, a VBA program running in Word could carry out procedures on an Excel file or a PowerPoint® file.

This is why you can create such powerful applications in Microsoft Office. A business may typically use Word for writing letters and reports, Excel for presenting and manipulating data, PowerPoint for presentations and Access™ for storing data. However many tasks and procedures require the use of more than one Microsoft Office program, e.g. you may need to extract sales data from a spreadsheet to a report. You can copy and paste the data but then you have to spend time formatting the document, checking the right data has been imported, updating any links to the data in the text of the report, etc. VBA enables the creation of automated reports and sophisticated templates. A VBA program can extract the relevant data from the Excel spreadsheet and place it in the Word report, it can add formatting, update links and perform validation checks. A VBA program would do this in seconds, much quicker than carrying out the procedure manually.

We have created a number of automated reports using Microsoft Office for many businesses. Automated reports can vary from the simple example outlined above to a sophisticated information system.

VBA also provides extra functionality to Microsoft Office programs. It can also override certain features, e.g. intercepting Word's Save or Print commands. This can be useful if certain documents have to be saved to a specific folder or if certain information needs to be inserted into a document or validation checks need to be performed before it can be saved.

Wizards are a feature that Microsoft Office uses to help a user to step through a task, e.g. the Mail Merge wizard in Word or the Conditional Sum wizard in Excel. VBA provides user forms (dialog boxes) to enable us to create custom wizards. Therefore, we can create a wizard for a procedure specific to your business. Dialog boxes are also useful for gathering information from users to input into a document or spreadsheet. Default values can be provided along with help prompts. Validation checks can be performed and specific formatting applied before the data is added to the document.

We have created a number of templates for Word and Excel that make use of wizards and dialog boxes and enhance the standard Microsoft Office features.


Copyright © 2007 Melf Computing Limited

Microsoft, Access, Excel, Visual Basic, Outlook and PowerPoint are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.

Terms and Conditions

Privacy Policy