Open Forum

Expand all | Collapse all

GP crashes every time any VBA code is run

Jump to Best Answer
  • 1.  GP crashes every time any VBA code is run

    SILVER CONTRIBUTOR
    Posted Sep 30, 2019 06:53 PM

    We have almost completed a test upgrade from GP 2013 to 2018.  GP is running normally until any VBA code is run. GP is installed on Server 2019 with SQL 2018. We have quite a few customizations in GP2013 using VBA. The project files imported without errors and all VBA code looks normal in the Editor. But GP crashes anytime VBA code is run.

    To simplify testing I removed the modified Forms and Reports dictionaries and the Dynamics.vba files. I added a standard (unmodified) GP form and the "New" button on the form to VBA, and created this Sub;

    Private Sub New_AfterUserChanged()

    End Sub

    The form that I added to VBA works normally until I click the New button which fires the event and runs the Sub. This confirms that the issue is not due to specific code but with the VBA environment.

     

    The Application log shows the following error;

    GP01   1026       Error      .NET Runtime    Application         9/26/2019 9:53:21 AM

    Application: Dynamics.exe

    Framework Version: v4.0.30319

    Description: The process was terminated due to an unhandled exception.

    Exception Info: System.AccessViolationException

       at <Module>.TNT_new_event_loop(Int16 (HWND__*, EVENT*, Int16*), Int16, Int16)

       at <Module>.dtw_run()

       at <Module>._WinMainCRTStartup()

     

    Searching the error found this post;  https://community.dynamics.com/gp/f/microsoft-dynamics-gp-forum/110463/gp-2013-intermittent-crash/239914

    A reply in the thread included 7 possible causes and resolutions but none of them resolved our issue.

    #VBA #Upgrade 

    ​​​Thanks in advance for any suggestions.

    ------------------------------
    Jeff Martin
    Director of IT
    DeRosa Corporation
    Wauwatosa WI
    ------------------------------
    Academy - Online Interactive Learning from Experts


  • 2.  RE: GP crashes every time any VBA code is run

    TOP CONTRIBUTOR
    Posted Oct 01, 2019 08:11 AM
    Jeff,

    We had some small VB customs on our windows that ran for years (multiple upgrades) without needing any attention.  Then they started to intermittently crash GP after we upgraded to GP2018R2.  My MS partner identified the offending code and fixed/upgraded it for me quickly.

    Maybe you are in the same situation as me (not having any GP development/Dexterity skills on staff).  Sometimes having good VB skills isn't enough.

    Chris





    ------------------------------
    Chris Donnelly
    Sr Mgr of Info Systems and Financial Reporting
    Healthmark Industries
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 3.  RE: GP crashes every time any VBA code is run

    TOP CONTRIBUTOR
    Posted Oct 01, 2019 08:26 AM
    What GP 2018 point release are you using? Windows Server​ 2019 is supported, but the System Requirements show Microsoft Windows Server 2019 Essentials Edition or Standard Edition (18.2.1007 GP version or later)

    Also here is a note on an Office/VBA issue...
    https://community.dynamics.com/gp/b/dynamicsgp/posts/dynamics-gp-crashes-closes-when-emailing-after-office-update


    ------------------------------
    David Morinello
    Senior Dynamics GP Systems Architect
    Ascend Learning, LLC
    Leawood KS
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 4.  RE: GP crashes every time any VBA code is run

    Posted Oct 01, 2019 09:14 AM
    Edited by Stephen Hudson Oct 01, 2019 09:14 AM
    I've seen this issue in the past when the .NET framework either is corrupt or isn't at the correct version. This link has the pre-req's for GP2018 R2, just in case you haven't seen them yet. https://docs.microsoft.com/en-us/dynamics-gp/installation/system-requirements

    ------------------------------
    Stephen Hudson
    Dynamics GP Developer
    Independent Contractor
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 5.  RE: GP crashes every time any VBA code is run
    Best Answer

    SILVER CONTRIBUTOR
    Posted Oct 03, 2019 11:57 AM
    Hello Jeff,

    You're running into a compatibility issue as Windows Server 2019 is not compatible with Dynamics GP 2018.  Support will be added with the Microsoft Dynamics GP (October 2019) release.  We've tested that release on Windows Server 2019 and VBA no longer causes the crash.

    We do not expect to port this compatibility back to previous versions of Dynamics GP.

    Let me know if you have any questions.

    ------------------------------
    Lucas Miller
    Support Escalation Engineer
    Microsoft
    Fargo, ND
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 6.  RE: GP crashes every time any VBA code is run

    SILVER CONTRIBUTOR
    Posted Oct 03, 2019 05:07 PM
    Thank you Chris, David, Stephen, and Lucas for your replies.  As David and Lucas mentioned there are still some compatibility issues with Server 2019. Our Partner had discussed the issues with us prior to starting the upgrade and we decided it was best to move forward with Server 2019. Out of habit I started testing on the server instead of on a pc. I have now installed GP 2018 on a pc and begun me testing. So far all of our VBA modifications seem to have upgraded without any problems and are working. We will avoid using the GP client on the server until we can test it with the October release.

    ------------------------------
    Jeff Martin
    Director of IT
    DeRosa Corporation
    Wauwatosa WI
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 7.  RE: GP crashes every time any VBA code is run

    Posted Jun 03, 2020 02:23 PM
    Hi,

    Curious if this issue was fixed. We are encountering the same error on GP18.2 (18.2.1060).
    GP is crashing when opening a modified form with VBA.
    OS: Windows Server 2019 Standard version 1809

    Application: Dynamics.exe
    Framework Version: v4.0.30319
    Description: The process was terminated due to an unhandled exception.
    Exception Info: System.AccessViolationException
    at <Module>.TNT_new_event_loop(Int16 (HWND__*, EVENT*, Int16*), Int16, Int16)
    at <Module>.dtw_run()
    at <Module>._WinMainCRTStartup()

    Application: Dynamics.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.AccessViolationException at <Module>.TNT_new_event_loop(Int16 (HWND__*, EVENT*, Int16*), Int16, Int16) at <Module>.dtw_run() at <Module>._WinMainCRTStartup()


    ------------------------------
    Kim Xavier Nati
    Encore
    Winnipeg
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 8.  RE: GP crashes every time any VBA code is run

    SILVER CONTRIBUTOR
    Posted Jun 03, 2020 02:43 PM

    Hello Kim,

     

    We are still unable to run VBA on Server 2019. VBA is running without any issues on our Windows 10 desktops with installed Office 2019 and GP 18.2.1036.

    ------------------------------
    Jeff Martin
    Director of IT
    DeRosa Corporation
    Wauwatosa WI
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 9.  RE: GP crashes every time any VBA code is run

    GPUG ALL STAR
    Posted Jun 04, 2020 03:07 AM
    Time to replace your VBA with a more stable (and web client compatible solution).

    https://winthropdc.wordpress.com/2019/08/12/gppt-replacing-vba-with-gp-power-tools-developer-tools/

    Regards

    David

    ------------------------------
    David Musgrave MVP, GPUG All-Star

    Managing Director
    Winthrop Development Consultants

    Perth, Western Australia

    http://www.winthropdc.com
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 10.  RE: GP crashes every time any VBA code is run

    Posted 15 days ago
    We are using GP2016R2 and we just setup a windows 2019 standard server.  When it tries to print invoices using vba GP crashes.  Is there a fix for this

    ------------------------------
    Larry Carrethers
    System Admin/DBA
    Dolese Bros. Co.
    Oklahoma City OK
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 11.  RE: GP crashes every time any VBA code is run

    GPUG ALL STAR
    Posted 15 days ago
    @Larry Carrethers

    You are already registered for GP Power Tools - Developer Tools module. You should replace your VBA with GPPT code (using Dexterity/SQL/C#/VB.Net as needed). It is more stable and reliable, faster and easier to maintain, deploy, upgrade and develop.

    Let me know if you need help.

    David​

    ------------------------------
    David Musgrave MVP, GPUG All-Star

    Managing Director
    Winthrop Development Consultants

    Perth, Western Australia

    http://www.winthropdc.com
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 12.  RE: GP crashes every time any VBA code is run

    Posted 15 days ago
    Are there instructions on how to change it?

    ------------------------------
    Larry Carrethers
    System Admin/DBA
    Dolese Bros. Co.
    Oklahoma City OK
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 13.  RE: GP crashes every time any VBA code is run

    GPUG ALL STAR
    Posted 15 days ago
    Edited by David Musgrave 15 days ago
    Not specific instructions, but you can develop equivalent code.

    Using GPPT (with Dexterity triggers) is much more efficient than VBA, so it is normally best to look at what the customization is doing and then decide on how best to achieve the same (or better) results using the features of GP Power Tools.

    There are samples on the GP Power Tools portal (http://WinthropDC.com/GPPT) but it does depend on what the big picture is.

    Contact me at support at winthropdc dot com to discuss further.

    Regards

    David

    ------------------------------
    David Musgrave MVP, GPUG All-Star

    Managing Director
    Winthrop Development Consultants

    Perth, Western Australia

    http://www.winthropdc.com
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 14.  RE: GP crashes every time any VBA code is run

    Posted 15 days ago
    ok, thanks

    ------------------------------
    Larry Carrethers
    System Admin/DBA
    Dolese Bros. Co.
    Oklahoma City OK
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 15.  RE: GP crashes every time any VBA code is run

    TOP CONTRIBUTOR
    Posted 15 days ago
    No fix and from what I hear, there won't be one. Time to start phasing out your VBA or use Windows 2016 and if needed(Mail), Office 2013.

    Check out this detailed description of the issues involved.
    https://community.dynamics.com/gp/b/dynamicsgp/posts/dynamics-gp-and-vba-future-considerations

    ------------------------------
    David Morinello
    Senior Dynamics GP Systems Architect
    Ascend Learning, LLC
    Leawood KS
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 16.  RE: GP crashes every time any VBA code is run

    GPUG ALL STAR
    Posted 13 days ago
    Lucas,

    I take you meant October 2020 release, 18.3, correct?

    ------------------------------
    Mariano Gomez Bent, MVP, Dynamics Credentialed Professional
    Director of Technology
    Mekorma
    ROSWELL GA
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 17.  RE: GP crashes every time any VBA code is run

    SILVER CONTRIBUTOR
    Posted 9 days ago
    Hello Mariano,

    When I posted that last October the hope was that Dynamics GP 18.2 would add VBA compatibility when running on Windows Server 2019, but that ended up not working out.  There is an incompatibility with our implementation of VBA and Windows Server 2019 and at this time there are no plans to change that.  If you need to use VBA then the GP client itself cannot be installed on Windows Server 2019.  You can certainly still use Server 2019 for your SQL Server, but GP itself needs to be on a previous server or client OS.

    This is also described in the following article we published:

    https://community.dynamics.com/gp/b/dynamicsgp/posts/dynamics-gp-and-vba-future-considerations

    ------------------------------
    Lucas Miller
    Support Escalation Engineer
    Microsoft
    Fargo, ND
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 18.  RE: GP crashes every time any VBA code is run

    GPUG ALL STAR
    Posted 9 days ago
    All the more reason to move away from VBA and use GP Power Tools Developer Tools module to replace all the code.

    It works with modified windows and works on web client. Can use Dexterity, SQL, C# or VB.Net without needing Dexterity, SQL Server Management Studio or Visual Studio loaded.

    No extra work needed to Deploy or upgrade. Can make changes without needing to restart GP.

    Learn more on the GPPT portal: http:// WinthropDC.com/GPPT

    Regards

    David

    ------------------------------
    David Musgrave MVP, GPUG All-Star

    Managing Director
    Winthrop Development Consultants

    Perth, Western Australia

    http://www.winthropdc.com
    ------------------------------

    Academy - Online Interactive Learning from Experts


If you've found this thread useful, dive deeper into User Group community content by role