Skip to main content

Notifications

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

  • Community Member Profile Picture
    on at
    RE: Dynamics GP VBA [ Compile Error Sub Or Function Not Defined ]

    Hey, show how I can do it.

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Dynamics GP VBA [ Compile Error Sub Or Function Not Defined ]

    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
    RE: Dynamics GP VBA [ Compile Error Sub Or Function Not Defined ]

    Hi Sandip,

    Yes it does show all fields.

    Thanks,

    Waqas

  • sandipdjadhav Profile Picture
    18,297 on at
    RE: Dynamics GP VBA [ Compile Error Sub Or Function Not Defined ]

    Waqas,

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

    Thanks

    sandip

  • Community Member Profile Picture
    on at
    RE: Dynamics GP VBA [ Compile Error Sub Or Function Not Defined ]

    Any support ???

  • Community Member Profile Picture
    on at
    RE: Dynamics GP VBA [ Compile Error Sub Or Function Not Defined ]

    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
    RE: Dynamics GP VBA [ Compile Error Sub Or Function Not Defined ]

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

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Almas Mahfooz Profile Picture

Almas Mahfooz 3 User Group Leader

Featured topics

Product updates

Dynamics 365 release plans