+ Reply to Thread
Results 1 to 4 of 4

User-defined type not defined on Copy to Clipboard Macro

  1. #1
    Forum Contributor vamosj's Avatar
    Join Date
    04-23-2004
    Location
    Oregon
    MS-Off Ver
    2010
    Posts
    294

    User-defined type not defined on Copy to Clipboard Macro

    So running a simple copy to clipboard macro and I am receiving a Compile error: User-defined type not defined error. This code worked on another spreadsheet where I had it embedded into a userform, so I'm a little confused as to the difference between the two events and why I'm receiving an error on this one.

    Reference to the Microsoft Office 14.0 Object Library is active.
    Reference to the Microsoft Excel 14.0 Object Library is active.

    Please Login or Register  to view this content.
    Last edited by vamosj; 09-23-2015 at 11:05 AM.
    Janos S. Vamos
    Data Systems Technician/Fire Controlman PO1(SW/AW)
    US Navy Retired


    Remember, Record Macro can be your friend for figuring out solutions.

    Good or Bad, let me know how I did by clicking on the "Add Reputation" * just to the lower left of here. it only takes a few seconds to let someone know.

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: User-defined type not defined on Copy to Clipboard Macro

    Good afternoon vamosj

    Hmmmmm, it's quite a while since I used the DataObject object, but i seem to remember that you need the Microsoft Forms 2.0 Object Library referenced.
    Try setting that one up.

    HTH

    DominicB

    Edit : BTW, setting up a userform automatically references the Forms 2.0 library, which is why this worked in your other file without you needing to set the reference.
    Last edited by dominicb; 09-23-2015 at 11:18 AM.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: User-defined type not defined on Copy to Clipboard Macro

    Add a userform, then delete it.

    Or you could try late-binding.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor vamosj's Avatar
    Join Date
    04-23-2004
    Location
    Oregon
    MS-Off Ver
    2010
    Posts
    294

    Re: User-defined type not defined on Copy to Clipboard Macro

    Quote Originally Posted by dominicb View Post
    BTW, setting up a userform automatically references the Forms 2.0 library, which is why this worked in your other file without you needing to set the reference.
    Quote Originally Posted by Norie View Post
    Add a userform, then delete it.

    This is how one suddenly feels like an idiot.

    Thank you Norie and dominicb, I now have access to my DataObject. Didn't have to delete the form, just had to have one. Now to go get more coffee.

    Thank you both.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Compile error user defined type not defined
    By elloco240866_Alsdorf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-31-2015, 02:26 AM
  2. [SOLVED] MSForms.CommandButton = User-defined Type not defined
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-30-2015, 07:35 AM
  3. Compile error: User- defined type not defined
    By rolex in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-14-2015, 05:08 PM
  4. Compile error: user defined type not defined
    By duhigs in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-23-2014, 07:51 PM
  5. [SOLVED] Compile error: User-defined type not defined
    By XmisterIS in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-21-2014, 09:46 AM
  6. compile error - user defined type not defined
    By TMP123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-23-2010, 01:42 PM
  7. VB Compile Error - User-defined type not defined
    By dbwiz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-08-2010, 04:31 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1