However, despite the development and live servers having exactly the same Windows and Dynamics GP configurations, the following error was generated on the live server when trying to run the macro:
Microsoft Dynamics GP
Keyword or punctuation expected, but not found. (Line #2)
# DEXVERSION=11.00.0359.000 2 2 CheckActiveWin dictionary 'default' form bmTrxEntry window bmTrxEntry TypeTo field 'TRX ID' , '262307A' MoveTo field 'TRX Date'
The code displayed above is from the macro file; the problem was the key words (such as dictionary) were not capitalised when the macro was recorded and tested on the development server, but needed to be capitalised for the live server. To get the capitalisation correct, I recorded a macro on live and then used the source CSV file to create a new macro by using the newly recorded one as a template for the mail merge.
It did mean that this was not tested the way the previous one was, but we’d proved the method on test and this was deemed acceptable.