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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

VBA Error

(0) ShareShare
ReportReport
Posted on by 1,958

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:
I have the same question (0)
  • Suggested answer
    Derek Albaugh Profile Picture
    on at

    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

  • Craig Fuller Profile Picture
    411 on at

    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.

  • Wilkerson64 Profile Picture
    5 on at

    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

  • Quintana28 Profile Picture
    5 on at

    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

  • Suggested answer
    Needles Profile Picture
    80 on at

    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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 503 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 434 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 278 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans