Removing References to Fields in VBA Revisited

David Meego - Click for blog homepageThis is a reposting of an article I originally wrote on my Developing for Dynamics GP blog.

Michael Johnson (the MBS Guru) has posted a great article about removing invalid references from a Visual Basic for Applications (VBA) project. This has prompted me to revisit the topic and gather together all the relevant resources from a number of blog authors.

A few months back, Mohammad Daoud published a post on the same subject. His method of removing the window from VBA and re-adding the window and fields back to VBA is the supported method for removing references to fields that no longer exist on the window.

Below are the links to the his article and some of my thoughts at the time:


However, what happens when you have a VBA customization with many fields added to VBA and only one or two that have been removed and are now causing errors?

You might remember how the Action Button replaced a number of other buttons in the v10.0 Sale Transaction Entry window.  This means that if the old Transfer, Delete, Post buttons etc. were previously added to VBA, they would now cause invalid reference errors.  See the links are the bottom of this post for more information on the Action Button.

Michael recently faced this situation when upgrading a site to v10.0. There were over 60 other fields added to VBA. Using the method mentioned in the previous articles would have required a huge effort to manually add the 60 fields back to VBA.  So Michael used a technique which has been mentioned before and manually edited the exported package file with Notepad.exe.  For the details, please see his post:

NOTE: The technique described here directly modifies the contents of a customization package with Notepad.  This technique is not supported by Microsoft Dynamics GP support.


For information on changing VBA or Dexterity code to work with the Action Button in the v10.0 Sales Transaction Entry (SOP_Entry) window, have a look at these related posts from Mariano Gomez and myself:

Hope you find this summary useful.

David

This article was originally posted on the Developing for Dynamics GP Blog and has been reposted on http://www.winthropdc.com/blog.

One thought on “Removing References to Fields in VBA Revisited

  1. Michael's avatar

    David,
    The specific problem I am working through is related to the Action Button on SOP Entry in v 10.  These posts will certainly be useful in my efforts.
    Thanks so much!
    Michael

Leave a Reply