Export VB Code
-
Export VB Code
Posted by Jeff Roe on May 30, 2017 at 3:22 pm-
I need to export all my customized VB code from GP.
Is there a simple way of doing all the forms at once vs exporting each (.frm and .frx)?
Thanks
——————————
Jeff Roe
Kele Inc
Bartlett TN
—————————— -
Hi Jeff
Are you talking about Modified forms and Visual Basic for Applications (VBA) code?
Have you looked at Microsoft Dynamics GP >> Tools >> Customize >> Customization Status?
Thanks
David
——————————
David Musgrave MVP, GPUG All-StarManaging Director
Winthrop Development ConsultantsPerth, Western Australia
http://www.winthropdc.com
——————————
——————————————- -
Hi Jeff,
I hope you like powershell & GP macros Ā š
Here’s some code that I’ve used for the past few years to save all of my customizations to our source code control system. Ā The powershell script (GeneratePackagesGPUG.ps1) launches GP with the GeneratePackagesGPUG.mac file (yes, there’s an embedded GP username and password – so please be careful where you store this file!) Ā After logging in, the macro file opens the Tools -> Customize -> Customization Maintenance window, highlights everything, then exports all of the customizations to the file: Ā All.Packages file. Ā Then it exits GP.
After running GP, the powershell script resumes by parsing the All.Packages file into separate package files for each form, report, or vba file. Ā Once the files have been generated, it exits GP.
There are some variables at the top of the script that you’ll need to modify for your environment:
$ProductIdsWeCareAbout – I have some third party add-ins that have their own customizations so I only script out customizations for the Base GP and Manufacturing.
$packageFolder – The folder (that must exist) where you want all of your packages to be stored
$gpMacroFile – I hope the name make sense
$progRoot – A simple way to see if the system is running 32 or 64 bit windows.
$gpVersion – If you are running something other than GP 2013 or GP 2015, you’ll have to fix this code accordingly.When editing the paths (which you will have to do), please note that the paths do NOT end with a
I also assume that the the GeneratePackagesGPUG.ps1 and GeneratePackagesGPUG.mac files are located in a folder named “Deploy” that is a subfolder under the folder where the packages are stored.
WARNING: This code works in my environment – Please use at your own risk!!! Ā I make no claims about it! Ā BACKUP, BACKUP, BACKUP!!!!
But, If you have any questions or problems, just yell and I’d be happy to help!
And, I just found out that I can’t upload a .ps1 or .mac file, so please remove the .txt extension before trying to use the files š
Good Luck & I hope this helps!
——————————
John Arnold
US Digital
Vancouver WA
——————————
——————————————- -
Thanks
I’ll try it
——————————
Jeff Roe
Kele Inc
Bartlett TN
——————————
——————————————- -
I use macros but for some reason when I use your powershell script it doesn’t login in to GP.
I will get to the GP login screen but never enters the credentials or login.
What can I check?
Thanks
——————————
Jeff Roe
Kele Inc
Bartlett TN
——————————
——————————————- -
John,
I tried this and I get the same result as Jeff.Ā The macro launches Excel, but stops at the login window and doesn’t enter the user name or password.
Also, what do you use for your source code control system?Ā We’ve been looking for something to help us keep up with the changesĀ we do on the reports and forms.Ā Ā That’s why we want to use package files instead of just copying the Reports.dic and Forms.dic.
Thanks.
——————————
Glenda Homan
Dolese Bros. Co.
OKlahoma City OK
——————————
——————————————- -
I am assuming you are talking about the VBA code.Ā In that case you would go to Tools>>Customize>>Customization Maintenance.
There you can select all the customizations at once by clicking on one and pressing CTRL-A.
Then click Export and fill in the dialog to save the package with all the customizations and VBA code contained inside.
——————————
Richard Kinning
Hillsborough Transit Authority (HART)
Tampa FL
——————————
——————————————-
Jeff Roe replied 8 years, 9 months ago 1 Member · 0 Replies -
-
0 Replies
Sorry, there were no replies found.
The discussion ‘Export VB Code’ is closed to new replies.