VBA error in hidden module Error 32 bit to 64 bit?

ipon70

Board Regular
Joined
May 8, 2013
Messages
90
Office Version
  1. 2016
Platform
  1. Windows
So I started getting this error ever since they upgraded to Officer 365.
The helpdesk says its a 32 vba error and needs to be 64 bit....

compileerror.png


Here is the code causing the issue. When the user clicks the delete button it literally doesn't even get the MSG box it just says that above message.

Sub Edit_db()
101:
Application.ScreenUpdating = False
Sheets("REVIEW").Visible = True
If Range("M4") = "" Then
MsgBox "You have left the ID number blank." & vbCrLf & "Please enter a item ID before pressing delete", vbQuestion + vbCritical + vbOK, "DATABASE ENTRY DELETE"
Exit Sub
Else
If Range("N4") = 1 Then
MsgBox "You are trying to delete a non item." & vbCrLf & "Please enter a valid item ID before pressing delete", vbQuestion + vbCritical + vbOK, "DATABASE ENTRY DELETE"
Exit Sub
Else
answer = MsgBox("This will delete the information shown from the database." & vbCrLf & "THIS CAN NOT BE UNDONE!" & vbCrLf & "Click YES to delete the information." & vbCrLf & "Click NO to cancel.", vbQuestion + vbCritical + vbYesNo, "DATABASE ENTRY DELETE")
If answer = vbYes Then
x = InputBox("Enter your Password.", "Password Required")
If x = "123456" Then
Call db_delete_entry
Call Clear_edit
Else
If i <= 1 Then
MsgBox "Invalid Password. Try again"
i = i + 3
GoTo 101:
Else
MsgBox "Incorrect password entered too many times. Try again later."
Exit Sub
End If
End If
End If
End If
End If
Application.ScreenUpdating = True

End Sub
 
Maybe I'd write it sorta like this
VBA Code:
Sub Edit_db()
Dim answer As Integer, i As Integer
Dim X As String, msg1 As String, msg2 As String, msg3 As String

msg1 = "You have left the ID number blank." & vbCrLf & "Please enter a item ID before pressing delete"
msg2 = "You are trying to delete a non item." & vbCrLf & "Please enter a valid item ID before pressing delete"
msg3 = "This will delete the information shown from the database." & vbCrLf & "THIS CAN NOT BE UNDONE!"
msg3 = msg3 & vbCrLf & "Click YES to delete the information." & vbCrLf & "Click NO to cancel."

On Error GoTo errHandler
'Sheets("REVIEW").Visible = True
If Range("M4") = "" Then 'no need to nest these tests if the result is to exit the sub
    MsgBox msg1, vbQuestion + vbCritical + vbOK, "DATABASE ENTRY DELETE"
    Exit Sub
End If

If Range("N4") = 1 Then
    MsgBox msg2, vbQuestion + vbCritical + vbOK, "DATABASE ENTRY DELETE"
    Exit Sub
End If
'if you get here, this becomes the main un-nested portion that was here before
'also, better to not alter application settings until all is OK

answer = MsgBox(msg3, vbQuestion + vbCritical + vbYesNo, "DATABASE ENTRY DELETE")
If answer = vbYes Then
    Do Until i = 3
        X = InputBox("Enter your Password.", "Password Required")
        If X = "123456" Then
            Application.ScreenUpdating = False
            'Call db_delete_entry
            'Call Clear_edit
            MsgBox "" 'this substitutes for Calls that I don't have
            Exit Do
        ElseIf i = 2 Then
            MsgBox "Incorrect password entered too many times. Try again later."
            Exit Sub
        Else
            MsgBox "Invalid Password. Try again"
            i = i + 1
        End If
    Loop
End If

exitHere:
Application.ScreenUpdating = True
Exit Sub

errHandler:
MsgBox "Error " & Err.Number & ": " & Err.Description
Resume exitHere

End Sub
I tend to put long message box text into string variables. Makes for shorter code lines that are easier to read, and if I want to edit the message, easier to do that too. Anything I commented out (e.g. because I don't have anything for the calls, or the right sheet name) would need to be fixed.
 
Upvote 0
I realize that
Yes but you asked if it should be X rather than i, it shouldn't be as X is the result of the message box and i is a separate counter, the error the OP posted isn't specific to being incompatible with 64bit btw.
After that, it will be 3 (i=1+3)
3 (i = 0 + 3), I don't know how many attempts the OP wants as that isn't producing the error, personally I would check Tools-References as a starting point,
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top