compile error

  • Thread starter Thread starter papa
  • Start date Start date
P

papa

I have received the following error:
compile error
user-defined type not defined

in my following code:
Private Sub CmdYesNoCancel_Click()
Dim answer As interger
answer = MsgBox("Press Yes to accept default values" + ",
Press No to enter new values," + "and cancel to exit.",
vbYesNoCancel + vbCritical, "The critical question.")
End Sub

The "CmdYesNoCancel" came from the top left drop down list
and click came from the top right. But when I run it and
click the button, the private sub line is what gets
highlighted when the error pops up.

I don't understand. I have a similar button which has the
same syntax and it works.
Any ideas?
TIA
 
Hi
the line
Dim answer As interger

has a typo. change
interger
to
integer
 
Is this code cut directly from your macro?

The data type Integer is mispelled interger.

The compiler think your assigning answer to a user defined type.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top