+ Reply to Thread
Results 1 to 3 of 3

getting user defined type not defined when trying to add a reference manually

  1. #1
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    getting user defined type not defined when trying to add a reference manually

    so here is the code that is failing:

    Please Login or Register  to view this content.
    on this line:

    Please Login or Register  to view this content.
    i am trying to add reference to "Microsoft Visual Basic for Applications Extensibility 5.3" programmatically

    note that i put the thisworkbook in ThisWorkbook code under Workbook_Newsheet

    what am i doing wrong?

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: getting user defined type not defined when trying to add a reference manually

    Quote Originally Posted by dmcgov View Post
    i am trying to add reference to "Microsoft Visual Basic for Applications Extensibility 5.3" programmatically
    Why? Just add it to the workbook manually. If you can't do that, late bind the code instead and avoid the reference altogether.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: getting user defined type not defined when trying to add a reference manually

    nm, i figured it out, needs to be in a standard module and it works.

+ 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. User-defined type not defined when copying macro from one workbook to another
    By Mogles in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2018, 08:08 AM
  2. [SOLVED] Outlook VBA, how to add reference library ["User defined type not defined" ERROR]
    By kelseygueldalewis in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-23-2017, 08:16 AM
  3. Replies: 4
    Last Post: 06-28-2016, 05:38 PM
  4. Replies: 2
    Last Post: 06-26-2016, 02:17 AM
  5. [SOLVED] User-defined type not defined on Copy to Clipboard Macro
    By vamosj in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-23-2015, 11:31 AM
  6. [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
  7. 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

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