Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

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

Posted on by Microsoft Employee

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
    Community Member Microsoft Employee 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
    Community Member Microsoft Employee 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
    Community Member Microsoft Employee 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
    sandipdjadhav 18,265 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
    Community Member Microsoft Employee on at
    RE: Dynamics GP VBA [ Compile Error Sub Or Function Not Defined ]

    Any support ???

  • Community Member Profile Picture
    Community Member Microsoft Employee 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
    Community Member Microsoft Employee 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans