Mission

getting into GiftWorks

In his blog, our CTO, Dave Weaver, provided a great introduction to the power and flexibility of the framework on which GiftWorks is built.  I wanted to demonstrate a practical use of the GiftWorks application framework and perhaps stir some ideas for those who have GiftWorks and want to explore some possibilities.

In this example, I am using a Excel and VBA (Visual Basic For Applications) to send spreadsheet data to GiftWorks.

the scenario

Many GiftWorks users have asked if there is a way to batch-enter many donors without having to go through the dialog process over and over.  Our common response is to encourage them to fill out an Excel spreadsheet and then to use the powerful import feature of GiftWorks.  Another way to accomplish batch entry would be to use the application framework to communicate directly from Excel to GiftWorks without having to go through the import process.

Excel and some code

You can download the sample Excel file here ExceltoGiftWorks.xls (44 KB)

When you open the Excel file, you may be prompted with a macro warning...be sure the Enable Macros so that the code within the Excel file will be enabled.  Your Excel file should look like:

Notice the data in the cells and the "Send To GiftWorks" button.  I have entered 3 rows of simple donor information and want to send this donor information to GiftWorks.  When I am ready, I can click on the "Send To GiftWorks" button and the donors will be created in GiftWorks.  Also, after the donors are added, the Donor Id column is updated with the donor's new id.  This id column is used to prevent duplicate donors in GiftWorks.  Pretty easy...but let's see how it's done.

code notes

With the Excel file open, press Alt-F11 and you should see the VBA editor.  Right-click on frmMain and choose View Code and you will see the code that adds the donors to GiftWorks.  Here are some notes regarding the code:

  • If you are not familiar with VBA and Excel, there is some great information at http://www.exceltip.com
  • The ActiveCell.CurrentRange is a reference to the active cells (as Excel defines them.   Excel looks where your cursor is and determines where the real data is surrounding your cursor.
  • Notice I retrieved the list of states from Giftworks using the App.Modules.Donor.Codes("state") call.  This method returns a collection object which I use to get the appropriate state code.
  • After the donor is inserted, I use the DonorId and update the column data.  The next time the "Send To GiftWorks" button is pressed, only the donors without a DonorId will be inserted.

summary

If you want to build a quick data entry add-on for GiftWorks, it can be easily done by using GiftWorks, Excel, and VBA.  There is no limit to what you can do!