Thursday, April 7, 2011

Error Importing Custom VBA Windows on GP 2010

This week I upgraded some old GP 9 Modifier & VBA customizations to GP 2010.

The upgrades went smoothly on my GP 2010 development server, and everything worked fine.  I exported a package with all of the modified forms, VBA code, and three custom VBA user forms and provided it to the customer to import.

When they tried to import the package, they received a message "Errors during load", which then referred to a log file. 

 In the log file, we saw the following message.

"Class {C62A69F0-.......} of control VerticalLookupForm was not a loaded control class."

When I checked my package file, that GUID was the one assigned to my custom user form.  So for some reason the form was not loading.

I then tried exporting the form from VBA on my development server, and tried importing the .frm file on the customer server, but that didn't work either. 

I then removed all mods from the client's server, opened VBA, and tried to create a new user form.  Even that produced an error.  So that told me that the issue was with the client's GP 2010 server, and not necessarily with my package file.  The error was:

Class not registered.
Looking for object with CLSID:{AC9F2F90-E877-11CE-9F68-00AA00574A4F} 
Fortunately, this is documented in KB article 18250.   The VBA problem is caused when the file FM20.DLL is not properly registered on the machine.

So, it's an easy fix to run regsvr32--in our case it was a 64-bit server, so the command was:

regsvr32.exe "C:\Windows\SysWOW64\FM20.DLL"

After running that command, user forms could be created in VBA, and my package file imported just fine.
The problem occurred on a GP 2010 server, but I assume that the issue can occur with other versions of GP.

Steve Endow is a Dynamics GP Certified Trainer and Dynamics GP Certified Professional.  He is also the owner of Precipio Services, which provides Dynamics GP integrations, customizations, and automation solutions.

1 comment:

Travis Dickson said...

Thanks for this reference - I see this issue every so often and always have to search for the answer.

For 32 bit systems use regsvr32.exe fm20.dll or regsvr32.exe %windir%\system\fm20.dll.