Skip to main content

Microsoft Dynamics GP and VBA: Future Considerations

UPDATE: We have just published the following article with a possible workaround for compatibility issues between Microsoft Dynamics GP's implementation of VBA and Microsoft Office and Windows Server 2019:

VBA causing issues in Dynamics GP?  Here's a possible solution.

As outlined in the following blog article our team has been made aware of compatibility issues between the Visual Basic for Applications (VBA) customizations and certain features in Microsoft Dynamics GP when newer releases of Microsoft Office and Microsoft Windows Server.

Microsoft Dynamics GP crashes/closes when emailing after Office Update


Note that this only applies to modified resources that use VBA. Modified forms and reports are still perfectly fine to use and they alone won’t cause issues with e-mailing out of Dynamics GP.

After communicating with the Office team it sounds like the redistributable version of VBA that is packaged with Microsoft Dynamics GP has reached end-of-life, which means it is no longer tested for compatibility with the monthly Office 365 releases. Such a compatibility issue was found in build 1811 and later versions of Office 365. It does not appear that there is a newer VBA redistributable that we could package with the Microsoft Dynamics GP installer that would address this issue. Since there are likely ISV products and customizations that require VBA and we want to maintain their functionality we’ve decided that the current VBA build will still be packaged with future installation media.

Microsoft Dynamics GP, VBA and Windows Server 2019

If you've launched Microsoft Dynamics GP on a Windows Server 2019 machine any implementation of VBA will cause the GP application to close.  This does not seem to be isolated to e-mailing, but rather any time a VBA customization is present on a window or report.  This is not an issue on earlier versions of Windows Server or any client OS.  If you need to use VBA in Dynamics GP you will need to have it installed on one of those previous operating systems.

After weighing our options to move forward we’ve identified the three following workarounds for you to consider:

1)      First, since the Web Client was initially introduced in Microsoft Dynamics GP 2013 we’ve heard of a push from many partners and ISVs to port their VBA customizations to another solution since VBA is not compatible with the Web Client. Similarly, if you were to migrate your VBA customizations to Dexterity or Visual Studio Tools there are no known compatibility issues with those solutions. You can use either C#.NET or VB.NET with VSTools, so you may already have someone in your organization with that knowledge. Several members of the community, including partners and MVPs, have published articles on this process. I’ve linked to an example of such an article below:

Migrating VBA Customizations to VS Tools for Dynamics GP

 

2)      The second option would be to maintain two different Dynamics GP client’s (installs/code folder): one with VBA customizations loaded and a second without any VBA. In this scenario when you need to perform an e-mail operation you will need to do so while logged into the VBA-free client. This would introduce some additional administration for the extra clients and depending on the nature of the VBA customizations it may not be possible to split the processes efficiently.

 

3)      Finally, the issue only occurs when you have VBA customization enabled and you’re using the MAPI Server Type.  This is because when you send an e-mail using MAPI the Outlook application itself is used to compose and send the e-mail message. If you switch to the Exchange server type (as found in the System Preferences window under Microsoft Dynamics GP > Tools > Setup > System > System Preferences) you should still be able to use VBA along with e-mail. The main limitation that could apply to this option is that you will need to be using Exchange for e-mail server rather than another solution.

 

Of course, we’re interested in any other creative solutions the Dynamics GP Community can come up with.

Please let us know if you have any questions on this.

Comments

*This post is locked for comments

  • Almas Mahfooz Profile Picture Almas Mahfooz 10,956 User Group Leader
    Posted at
    If anyone here looking for resource to convert VBA customization to dexterity, I am right here. :) Just contact with me almasmahfooz@hotmail.com
  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture David Musgrave MVP ... 13,781 Super User
    Posted at
    One solution would be to replace VBA code with GP Power Tools - Developer Module triggers and scripts. winthropdc.wordpress.com/.../
  • GuillaumeS Profile Picture GuillaumeS
    Posted at
    Does Microsoft plan to fix that issue in an upcoming release of GP ? The real solution would be to update the VBA package to the latest version. Office still supports VBA in Excel for instance and I assume that they don't have that bug.
  • durwinbr Profile Picture durwinbr
    Posted at

    Hi Isaac Is that a recent change? The current system requirements for GP2018 says "2. The Exchange server type only supports XPS and DOCX." I've not been able to test this to make sure yet.

  • Isaac Olson Profile Picture Isaac Olson
    Posted at

    I just wanted to comment on the last message to clarify for those that are reviewing this blog post.  You can send Word Templates as PDF using MAPI or Exchange in GP.  You cannot send generic Report Writer reports as a PDF when you are set to Exchange (emailing the old way).  So Exchange in this case would work just fine as a workaround as Lucas mentioned.  

    Thanks!

    Isaac Olson

    Microsoft Support

  • durwinbr Profile Picture durwinbr
    Posted at

    The issue with sending via Exchange is that PDF document type is not supported; for PDF you must use 32 bit Outlook MAPI. Most customers want to send PDF rather than Word read only. If this was sorted it would be deal with this VBA issue plus simplify GP client rollout generally.