Archive for the ‘VBA’ Category

Excel VBA Code Updater

Saturday, May 17th, 2008

One problem when developing VBA applications is that bringing bugfixes and improvements to your users can be difficult since an Excel Workbook contains both, code and data. Certainly you cannot expect the typical MS Excel user to import .bas files or things like that.

To solve this problem, I wrote a small Excel tool called ‘VBA Updater’. It updates the VBA code of an Excel Workbook from another Workbook without touching the data in the Worksheets.

You can find a description and the tool at: VBA Updater

The VBA Updater Tool

Dynamic Dialogs in Excel VBA

Thursday, July 19th, 2007

The problem:
You want to have a User Form (a VBA-Dialog) which

  • controls (buttons, text fields etc.) are created at runtime based on information that is read from e.g. a table
  • event handling of those controls is created at runtime.
  • For a solution of these problems check the following file and/or read on.
    Example Code for Dynamic Dialogs in Excel VBA

    Consider the following example: There is a table which contains products of some type. Each product has some properties like description, prize etc. This table is created by some database queries. Hence, you do not know how much entries the table will have.
    You want to provide the user of your Excel application with an easy way to select those products and insert them in another table (e.g. an invoice). If a user wants to insert a product into the invoice, he clicks a button and you would like to present him a User Form that has one button for each product. If he clicks on one button, the concerning product is inserted into the invoice table with its description, price etc.

    Dynamic Dialogs in Excel at Work

    (more…)