• Error Messages: User-Defined Type Not Defined

    There are a great many errors that we can run into when programming, and just on of those is a Compile Error, specifically "User-Defined Type Not Defined".

    This error could mean one of a few different things, which may not all be listed here. Two of the most common, however, are:
    1. You are trying to create your own Constants and did not declare the Enum. (For an example of this, see my article on Creating Your Own Constants For Functions)
    2. You are automating an external program, (using Early Binding,) and forgot to set a reference to the required library.

    The steps that are listed below are assuming that you need to set a reference to PDFCreator in order to use some one of the PDFCreator examples on this site. Be aware that this could just as easily be applied to setting a reference to Word, Access or any application that you are attempting to set an Early bind to.

    To set a reference:

    • Enter the Visual Basic Editor (VBE)
    • Go to Tools|References
    • Scroll down the list until you find the library that you need and check the box:
    • Click OK, and your reference is set

    Hints:
    • To move quickly down the list, click an item and then press the first letter in the reference name. ("P" for PDFCreator.) You'll jump right to the "P" section of the list without having to scroll all the way down.
    • Remember that most Microsoft libraries are prefaced with Microsoft. If you're looking for the Word Object library, look for Microsoft Word

     

    I'm afraid that you must be logged in to comment or leave a testimonial. I wish it could be otherwise, but I'm trying to keep my site spam free for everyone's benefit. If you don't yet have an account it's completely free to sign up, and a very quick process. Simply click here to Register. Not only can you post a comment here, but it gives you full access to posts questions in our forum as well!

     

    If you already have an account, and just haven't logged in yet, what are you waiting for? Login Now!

  • MVP Logo
  • Recent Forum Posts

    Bob Phillips

    Please help!

    This array formula will add up the sums

    =SUM(IF(A2:A20"",(--LEFT(A2:A20,8)=--"2020-11-24")*SUBSTITUTE(MID(A2:A20,11,99),")","")))...

    Bob Phillips Yesterday, 08:46 PM Go to last post
    Bob Phillips

    Index/match with multiple match criteria

    When I said Q1, I meant Quarter 1, cell E31, not cell Q1.

    It most definitely does match your last upload, C8:C30 is the date which I parse,...

    Bob Phillips 2020-11-24, 06:44 PM Go to last post
    GLewis14

    Consolidate paired data sets

    hi all,

    I have a sheet which contains data sets (3 rows per data set), see Product Level sheet of attachment. I want to consolidate and total...

    GLewis14 2020-11-24, 02:46 PM Go to last post
    alansidman

    Please help!

    What is the criteria for counting the quantity. Would be helpful if you provided a sample workbook showing what you have and what your expected results...

    alansidman 2020-11-24, 06:21 AM Go to last post
    cprop76

    Please help!

    I am trying to count two separate pieces of data which appear in the same excel column. The columns will have a date followed by a quantity so look something...

    cprop76 2020-11-24, 05:52 AM Go to last post