VBA Not Initialized Error

Microsoft Dynamics GPI seem to have spent a lot of time over the last few months building demo machines; I’m not sure I have, but it seems that way with the rapid release schedule that Microsoft Dynamics GP was on.

I’ve seen the below error message a few times when trying to import VBA customisations and have had to do an investigation each time as to what the problem was, before realising it was exactly the same problem again:

Microsoft Dynamics GP: VBA cannot be initialized. Cannot import this package because it contains VBA components.

Microsoft Dynamics GP

VBA cannot be initialized. Cannot import this package because it contains VBA components.

This post, is in an attempt to remind myself of what the error is without having to investigate.

The issue each time has been that the registration keys for Microsoft Dynamics GP have not been entered; VBA customisations cannot be imported if the Customisation Site Licence is not registered.

Once the keys are entered, the error goes away and the VBA customisations can be imported without further issue.

VBA for Integration Manager to Insert Vendor EFT Bank And Email Addresses

Microsoft Dynamics GPI did a SQL Script back in October 2014 which allowed Vendor EFT Details to be inserted, but, if the client is going to run it themselves, requires the assistance of the IT Department as end users don’t usually have access to SQL Server Management Studio.

For most clients, this hasn’t usually been a problem, but a number of the clients I have worked with recently have had multiple projects on the go at the same time. This has meant that while an IT representative can be available, it isn;t usually very timely and can delay UAT.

As such, I wrote some VBA script for Integration Manager which inserts both the Vendor Email and EFT Details. Continue reading “VBA for Integration Manager to Insert Vendor EFT Bank And Email Addresses”

Execute Batch File In Integration Manager

Microsoft Dynamics GPI can’t remember why I created this code, but it allows a batch file to be run from an Integration Manager script:

/*
Created by Ian Grieve of azurecurve|Ramblings of a Dynamics GP Consultant (http://www.azurecurve.co.uk)
This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int).
*/
Set objShell = CreateObject("WScript.Shell")
Set objExec = objShell.Exec("B:\IM.bat")

I’m posting it here so I don’t lose it for when I remember why I write it, and perhaps it may be useful to others.

Integration Manager VBA Script To Create XML Output

Microsoft Dynamics GPWe have a client who will be loading payables transactions into Microsoft Dynamics GP and need secondary postings created into the General Ledgers of other company databases. The idea is to use the AfterDocument script to create and submit an eConnect document, which is in XML format.

The below code is a small proof of concept which creates an XML file with child and parent nodes and saves it to the T:\:

/*
Created by Ian Grieve of azurecurve|Ramblings of a Dynamics GP Consultant (http://www.azurecurve.co.uk)
This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 2.0 UK: England & Wales (CC BY-NC-SA 2.0 UK).
*/
Set xmlDoc = CreateObject("Microsoft.XMLDOM")

Set objRoot = xmlDoc.createElement("RootElement")
xmlDoc.appendChild objRoot

Set objRecord = xmlDoc.createElement("SubLevel1")
objRoot.appendChild objRecord

Set objName = xmlDoc.createElement("Element1")
objName.Text = "AAAAAAA"
objRecord.appendChild objName

Set objDate = xmlDoc.createElement("Element2")
objDate.Text = "BBBBBBB"
objRecord.appendChild objDate

Set objIntro = xmlDoc.createProcessingInstruction ("xml","version='1.0'")
xmlDoc.insertBefore objIntro,xmlDoc.childNodes(0)

xmlDoc.Save "T:\Test.xml"

Integration Manager Error: Error Executing Script ‘Before Integration’ Line 17: – Object required: ‘gpObj’

Microsoft Dynamics GPOne of Perfect Image’s clients is merging with another organisation and I’ve been onsite a few times to help them configure the new companies and import data. One of the items on my list was to use Integration Manager to import the new chart of accounts. While doing this I used VBA to extend the integration to map between the chart of accounts in the new system to the new format and numbering wanted in Microsoft Dynamics GP.

It was when I came to test the integration with the mapping active that I encountered my problem:

ERROR: Error Executing Script 'Before Integration' Line 17: - Object required: 'gpObj'

Show/Hide Error Message

ERROR: Error Executing Script 'Before Integration' Line 17: - Object required: 'gpObj'
Error Executing Script 'Before Integration' Line 17: - Object required: 'gpObj'
Object required: 'gpObj'
Integration Failed
Integration Results
    0 documents were read from the source query.
    0 documents were attempted:
        0 integrated without warnings.
        0 integrated with warnings.
        0 failed to integrate.

Continue reading “Integration Manager Error: Error Executing Script ‘Before Integration’ Line 17: – Object required: ‘gpObj’”

Form Customisation Errors Adding Fields To VBA

Microsoft Dynamics GPSince the introduction of the web client in Microsoft Dynamics GP 2013, I have tried to minimise the use of VBA as it is not supported by the web client. However, some clients don’t intend to use the web client and prefer to have a quick customisation to a window done using VBA rather than full development in Dexterity.

As such, I do still sometimes get work with Modifier and VBA. I recently did a change to a client where I added several fields to VBA on the Sales Transaction Entry window.

A little later I needed to add a new checkbox and add it to VBA. I customised the window in Modifier to add the field, but when I tried adding it to VBA I received an error I had not seen before:

Microsoft Dynamics GP - You are manipulating a modified window whose EventMode is set to emOriginalOnly. You must change this window

Microsoft Dynamics GP

You are manipulating a modified window whose EventMode is set to EmOriginalOnly. You must change this window's EventMode to emModifiedOnly before you can add this field.

Continue reading “Form Customisation Errors Adding Fields To VBA”

Error Printing Batch Of Cheque Remittances

Microsoft Dynamics GPI recently assisted a client with an upgrade of Microsoft Dynamics GP 10 to GP 2013 R2. As part of the upgrade we assisted the client to create some Word Template versions of sales invoice, purchase order, and cheque remittance (or check remittance to the American readers).

Everything appeared fine during development and initial testing. Fine that is until we tried producing a batch of twenty remittances which produced the following two error messages:

Microsoft Word - The file Check Remittance~2 cannot be opened because there are problems with the contents.Microsoft Word – The file Check Remittance~2 cannot be opened because there are problems with the contents.

Continue reading “Error Printing Batch Of Cheque Remittances”

Error 800AC351 While Saving Microsoft Dynamics GP

Microsoft Dynamics GPI was working onsite with a client during an upgrade of Microsoft Dynamics GP from version 10 to 2013 recently, and after doing some work on a client we started receiving an error when trying to log out..

The error we received was the following:

Microsoft Dynamics GP - Unknown error 0 - 800AC351 occurred saving the project fileMicrosoft Dynamics GP – Unknown error 0 – 800AC351 occurred saving the project file

After a little testing to see if we could easily determine the problem, I did a quick online search and came up with this post from Vaidy Mohan which was the same error, but for a different VBA project.

The steps I tried and found to be successful were slightly shorter and easier than those Vaidy needed:

  1. Launch GP and open the Visual Basic Editor
  2. Opened modified report in the Microsoft Dynamics GP VBA project
  3. Added and removed a space from the end of one line
  4. Compiled the entire project to check for errors
  5. Save VBA project
  6. Log off from GP

To verify the problem was resolved we closed and reopened Dynamics GP and didn’t see the error when closing it again.

Problem Adding Fields To VBA in Microsoft Dynamics GP 2013 R2

Microsoft Dynamics GPI had a colleague (actually the First Minion, Erebus) using Modifier with VBA to create a customisation of the Account Maintenance window (Financial area page ¯ Cards ¯ Account) in Dynamics GP 2013 R2 (for a client who does not and will not be using the web client). This customisation required a small number of fields and the save button to be added to VBA.

When he was adding the fields everything was fine, but as soon as he tried to add the save button the cursor changed to a standard one and did not allow the save button to be added. Microsoft Dynamics GP 2013 R2 saw the introduction of the action pane (or ribbon bar as I keep on calling it):

Account Maintenance action pane

Continue reading “Problem Adding Fields To VBA in Microsoft Dynamics GP 2013 R2”

File Not Found: VBA6.DLL

Microsoft Dynamics GPWhile VBA is falling out of favour with Microsoft Dynamics GP (by dint of not being supported in the web client) it is still useful for those clients who do not use, and have no intention of using, the web client.

One such client was recently installing some new XenAPp servers using Windows Server 2012; when they tried to open a window with a VBA customisation they received the following error:

File Not Found: VBA6.DLLFile Not Found: VBA6.DLL

Fortunately, Beth Gardner posted the answer to the Developing for Dynamics GP blog.