none
FRUSTRATING EVENT - USER DEFINED ERROR RRS feed

  • Question

  • I posted this problem under Office/Excel/Windows 10 but was told it was the wrong place and I should post the problem here, so here goes.  (Please excuse my ignorance as I am not a developer although a long time Excel user).

    I am running Windows 10 with Office365 and Excel 2016.  Suddenly a few days ago, for no apparent reason, when I enter something, anything, into a spreadsheet, be it new or and older spreadsheet, and then click on "ENTER" to enter the data,  I then immediately receive an error message which appears as is shown below:

    ERROR MESSAGE:

    MICROSOFT VISUAL BASIC FOR APPLICATIONS
    USER-DEFINED  TYPE NOT DEFINED

    This is what I do not understand.  I am a LONG time user of Excel, in fact, I was a Beta tester.  I have NEVER run into this one time in my life.  There have been no updates or changes to my system whatsoever for over a month!  Nothing was defined in any spreadsheet whatsoever of any type of data other than standard data entry.  So then, why suddenly did this error message begin popping up EVERY SINGLE TIME I ENTER ANY DATA OF ANY TYPE WHATSOEVER?  It does NOT make any difference if what I enter is text, currency, raw data, numbers or what it is, I get this error message.  When I do get it, there is a selection of either  "OK" or  "HELP".  Clicking OK merely allows us to continue until the next time I hit the ENTER key again, the error message pops up again, and again, and again!  Something somewhere changed.  The only thing I have done in any respect was the other day I tried to enter the time into a spreadsheet I setup as a calendar and when I did enter the data, Excel wanted to display the data as a date, so I then again clicked on the cell and did "FORMAT CELLS" and then "TIME" and selected the way I wanted the time displayed.  I have probably previously done this dozens upon dozens of times and did not run into this problem.  I cannot recall if these error messages then began immediately but I do not believe they did.

    I must ask, what has caused this and how do I stop it and you should know, I have NEVER used Visual Basic for anything.

    To be clear, if I click on "HELP", I get the following and none of it applies -

    (Sorry, I was going to provide the address for the help article but the wisdom here caused an error message:  Body text cannot contain images or links until we are able to verify your account, so I had to remove the address.  Again, sorry.)
    "User-defined type not defined
    Office 2013 and later 
    You can create your own data types in Visual Basic, but they must be defined first in a
    Type...End Type statement or in a properly registered object library or type library. This error
    has the following causes and solutions:
    ·         You tried to declare a variable or argument with an undefined data type or you specified 
    an unknown class or object.  (NO, I did not do this!)
    ·         Use the Type statement in a module to define a new data type. If you are trying to create
    a reference to a class, the class must be visible to the project. If you are referring to a class in 
    your program, you must have a class module of the specified name in your project. Check the 
    spelling of the type name or name of the object.  (NO, I did not do this!)
    ·         The type you want to declare is in another module but has been declared Private.  Move
    the definition of the type to a standard module where it can be Public. (NO, I did not do this!)
    The type is a valid type, but the object library or type library in which it is defined isn't 
    registered in Visual Basic. Display the References dialog box, and then select the appropriate 
    object library or type library. For example, if you don't check the Data Access Object in the 
    References dialog box, types like Database, Records**, and Table*** aren't recognized and
     references to them in code cause this error. 
    ·         For additional information, select the item in question and press F1 (in Windows) or
     HELP (on the Macintosh)."  end of help information"

    Again, NOTHING in the help section applies to anything I am doing in Excel and therefore I have no idea as to the cause of the problem (error) or what to do to stop it from happening and it is getting very frustrating indeed.  Further, it would help, I am sure, if I knew what I had done to trigger going into Visual Basic and how to turn it off or get out of it.  You should also know that I often save the Excel files as Excel 97 - 2003 Workbook.  But, I have been doing this since last fall when I acquired this new system and never experienced this problem until a few days ago.  It is about to send me up the wall and I just don't want to go up the wall but prefer walking upon the floor (sorry for the sick humor but I have to do something to smile).

    I sincerely will appreciate any help you can provide with these issues!  THANK YOU!

    Thursday, March 23, 2017 9:56 PM

All replies

  • If you are using VBA code in your application then you should post your question here:

    Visual Basic for Applications  (VBA)

    If you are not aware of any use of VBA then you have a problem either with default code that is being automatically loaded with each spreadsheet, or some malware (which amounts to the same thing).  In either case the correct forum is the Excel forum.  While the problem is with VBA code somewhere, the process of finding why that code is executing is something that Excel experts can handle.

    Thursday, March 23, 2017 10:07 PM
  • Hello,

    Sorry to hear of this issue. Unfortunately this is not the correct forum either.

    The best suggestion is to turn off macros in Excel as per this page. If that does not help your options are to contact Microsoft here or worst case is to do a repair.

    I'm moving your question to the Excel for developer forum even thou it's not in the realm of coding, perhaps someone there may have knowledge that can assist you in the right direction.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Thursday, March 23, 2017 10:17 PM
  • Thanks Karen.  Can you please give me the address for the forum you moved this problem to?  Thank you.
    Friday, March 24, 2017 12:25 AM
  • Thanks Karen.  Can you please give me the address for the forum you moved this problem to?  Thank you.

    You should had received an email with the address to this thread. Any ways this is the forum.

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Friday, March 24, 2017 12:52 AM
  • Hi TemporaryUser0101,

    you get error ,"USER-DEFINED  TYPE NOT DEFINED"

    let me inform you first that this error occurs if reference is missing in the VBA code and you try to run the code.

    you mentioned that error occurs when ever you try to enter value.

    so it is possible that when you enter some value that code is getting execute.

    please try to open Visual Basic from the "Developer Tab" (alternatively you can press Alt + F11) and check whether there is some code available or not.

    try to create a new workbook and check whether you can reproduce the issue.

    if you can reproduce the issue then try to check for AutoExec Macro.

    if you are not running any code and simply want to use Excel Application then go to "Macros" in "Developer Tab". like below.

    click on "Macros". following window will be opened.

    check any macro is available or not.

    if macro is available and you don't want to use that anymore then you can delete that. (check it before you delete any important code.)

    if that macro is useful for you then you need to solve the error by adding the missing references.

    Try to test above suggestions and let me know about the results.

    so that I can try to suggest you further to solve the issue.

    Reference:

    User-defined type not defined

    Error 'Compile Error: User-defined type not defined' Attempting to Compile Code

    Further if you are not using any macro then you can try to disable it with notification may solve your issue.

    you can follow steps below to disable the macro.

    1. Click Options.

    2. Click Trust Center, and then click Trust Center Settings.

    3. In the Trust Center, click Macro Settings.
    4. Make the selections that you want.
    5. Click OK.
    6. Click the File tab.

    Reference:

    Enable or disable macros in Office files

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Friday, March 24, 2017 3:14 AM
    Moderator