web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Dynamics GP VBA [ Compile Error Sub Or Function Not Defined ]

(0) ShareShare
ReportReport
Posted on by

HI,

We are facing a strange issue. We have customized Payable manual payment entry using VBA & Modifier. There is one button and behind it there is VBA Code to print the crystal report.

It works fine on all clients, but on one newly installed client ( Both XP & Windows 7) we are getting the compilation error after package deployment.

Compile Error:

"Sub Or Function Not Defined"

We did the following to resolve this 

  1. Using Customization Maintenance, export all the resources by using VBA as packages.
  2. Exit Microsoft Dynamics GP and rename, delete, or move all the *.VBA files.
  3. Start Microsoft Dynamics GP and use Customization Maintenance to import the .package files

It works fine but as soon as you log out Dynamics GP & login back it gives the same error.

Any Idea why this is happening ?

Thanks,

Waqas

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Have you tried stepping through the code to see where the error is coming up?

  • Community Member Profile Picture
    on at

    It is on the load  event for a custom VBA Form.

    The code is as follows

    Load TLREPORT

    TLREPORT.show

    Thanks,

    Waqas

  • Community Member Profile Picture
    on at

    Any support ???

  • sandipdjadhav Profile Picture
    18,319 on at

    Waqas,

    Can you please check if you see all customzed fields on new client?

    Thanks

    sandip

  • Community Member Profile Picture
    on at

    Hi Sandip,

    Yes it does show all fields.

    Thanks,

    Waqas

  • Verified answer
    Community Member Profile Picture
    on at

    Hi,

    Have sorted the issue. when debugging by making all functions public ( from Private ) got the exact error and it was related to VBA6.dll missing issue.

    Now have updated the registry with correct VBE6.dll and it resolved the issue.

    Thanks,

    Waqas

  • Community Member Profile Picture
    on at

    Hey, show how I can do it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans