• 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
  • MVP Logo
  •  Donations

    If you like our website and would like to give something in return, you can make a donation. All donations are gratefully received and go to support the site.


    Select your preferred currency and donation amount, then click the donate button.

  • Recent Forum Posts

    Colo

    How to Rename a File from English to Other Language?

    Yeah, some massive HTML conversion is my line. In other words, most of difficult things can be done with Excel alone like this time. Well done, Excel!...

    Colo Today, 07:36 AM Go to last post
    Ken Puls

    Link a series name to a cell using Excel 2010 VBA

    Hi there,

    I recorded linking the title to a cell and it came back with the following. Does this help?

    Code:
        ActiveChart.SetElement
    ...

    Ken Puls Today, 04:06 AM Go to last post
    Ken Puls

    How to Rename a File from English to Other Language?

    Colo, that was way too easy... I was expecting some massive HTML conversion, or a huge engine to compare each character against a library of Chr codes!...

    Ken Puls Today, 04:02 AM Go to last post
    Ken Puls

    Shared file\macro & IP address

    Oh, and as for the max number of users who can access the file in the shared folder at once...

    • For reading, I believe it's unlimited. (The second and
    ...

    Ken Puls Today, 03:59 AM Go to last post
    Ken Puls

    Shared file\macro & IP address

    ibrahimaa,

    There is no one-line way to get your IP address the way you are getting the username. So you're going to need more code than...

    Ken Puls Today, 03:56 AM Go to last post