VBA – Adding Fields to VBA stops working

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

While working with Microsoft Dynamics GP v9.00, I have seen a situation where adding fields to VBA does not work anymore.  You can add windows and reports, but when adding a field they don’t show up on the project.

If you try to import a package file with with a customsation using Customisation Maintenance you will receive a “Component Write Exception” error and the VBA part of the code will have not imported correctly.

I am not sure exactly what is going wrong and it is difficult to reproduce this issue on demand.  This probably explains why it has not been fixed yet.  It does not seem to happen with v8.00 or v10.00.

The only solution I know to resolve this is to export all the customisations as packages using Tools >> Customise >> Customisation Maintenance.  Then you can rename all the custom forms and reports dictionaries and the *.vba files to remove all the customisations. Then you can import the customisations back using the previously exported packages.


  • Import reference packages before importing other packages to avoid referencing errors.
  • If you made format, string or message changes they will need to be remade as they are not included with packages.  Record a macro of these changes if you want to be able to remake them on demand. For more information see Formats Not Exported to .Package Files (KB 851092).

Post a comment if this has happened to you, especially if you know how to consistently reproduce the issue.


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

2 thoughts on “VBA – Adding Fields to VBA stops working

  1. I modified the bank deposit entry window and couldn’t add fields in VBA, even though it let me ad the window. The odd think is, it added the window under the wrong object in VBA, in my case project accounting (as in Microsoft_Dynamics_GP > Project_Accounting_Object).  PA doesn’t have an alternate bank deposit window.
    I tried your suggestions, i.e., renaming Dynamics.vba and Forms.dic, with no luck.  I tried changing the status of PA to disabled, still no change.  Then I went into the set file and took out PA, and tried again.  This time, it put the window into VBA under a different object: Microsoft_Dynamics_GP > Fixed_Assets Object.  I then stripped the set file of everything except the dynamics dictionaries, deleted Dynamics.vba and Forms.dic, and modified the window manually again.  When I added it to VBA this time, it was under Microsoft Dynamics GP Objects as it should be, and the fields I’d added were there.  I saved everything and logged out and put the original set file back, and when I went back in the fields were still there and the form was listed under the correct object.
    Dynamics version 9.00.0281, Dex version 9.00.0073.0
    Jarn Heil


Please post feedback or comments

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.