Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

VBA Error

(0) ShareShare
ReportReport
Posted on by 1,930

We had a custom form with VBA that was working fine in GP 2016

After upgrading to 2018.3 the form is throwing an error Object Not Found 424  ( I have highlighted where the VBA breaks)

sqlstring = "SELECT isnull(sum(HOURSAVAILABLE_I),0) as HOURSAVAILABLE_I FROM TATM1030 WHERE TIMECODE_I = 'VACTC' and empid_I = '" & RTrim(EmployeeID) & "'"

' ADO Command
cmd.ActiveConnection = cn
' adCmdText
cmd.CommandType = 1
' Command
cmd.CommandText = sqlstring
Debug.Print sqlstring

' Pass through SQL
Set rst = cmd.Execute
If Not (rst.EOF And rst.BOF) Then

HRAttendEndBal1.Value = RTrim(rst!HOURSAVAILABLE_I) * 0.01

I understand VBA is going away - but this is simple form that has been working for sometime and now after the upgrade it is broken.

Thanks

Categories:
  • Suggested answer
    Needles Profile Picture
    Needles 80 on at
    RE: VBA Error

    We have had success running VBA code after adding Dynamics.exe to the DEP exceptions list.

    Open Windows Control Panel and select System and Security.

    Select System

    Select Advanced system settings.

    Select the Advanced tab in the System Properties window, then select Settings under Performance.

    Select the Data Execution Prevention tab

    select "Turn on DEP for all programs and services except those I select."

    Select Add and then browse to Dynamics.exe and then apply.

  • Quintana28 Profile Picture
    Quintana28 5 on at
    RE: VBA Error

    VBA enables an error-handling routine and can also be used to disable an error-handling routine. Without an On Error statement, any run-time error that occurs is fatal: an error message is displayed, and the execution stops abruptly.

    mybpcreditcard

  • Wilkerson64 Profile Picture
    Wilkerson64 5 on at
    RE: VBA Error

    What are Compile Errors? Compile errors refer to a wider group of VBA errors, which include syntax errors. Compile errors also identify problems with your code when considered as a whole. The syntax of each individual line may be correct, but when put together, the lines of your code don't make sense.

    skylightpaycard

  • Craig Fuller Profile Picture
    Craig Fuller 409 on at
    RE: VBA Error

    I haven't touched Modified forms for a great while but my gut says that it is looking for a field you added named HRAttendEndBal1 on your modified form and cannot find it. You could go into modifier and add it again (or see if it is already there. Did you check that the SQL still returns a value? I assume you checked references like Derek mentioned.

  • Suggested answer
    RE: VBA Error

    If you haven't already, verify in VB Editor that you have the same libraries and references added. We frequently see where, after upgrading, VB Editor won't have the libraries/referenced added that it had at the previous version, causing errors such as this.

    Otherwise, other than the error 424 seems to imply 'object not found', I didn't find anything much more as to this error message, though I imagine our community developers may have seen this type of message and can assist....

    Thanks

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

News and Announcements

Announcing Category Subscriptions!

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 Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans