+ Reply to Thread
Results 1 to 3 of 3

adding references programmatically

  1. #1
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    862

    adding references programmatically

    Hi guys!

    I have a code on Workbook_Open() event that require Extensibility (see below)
    Is there a way to add reference to Extensibility on Workbook_Open() before declaring the VBIDE variables ?
    What I mean is that I need to run this code on Workbook_Open()

    Please Login or Register  to view this content.
    before this one (also on Workbook_Open() event):

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: adding references programmatically

    Hello bulina2k,

    There is no need to import the VBIDE as Excel does this automatically for macro enabled workbooks. You instead can reference the VBIDE through late binding. Here is an example...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    862

    Re: adding references programmatically

    thanks a lot Leith Ross ! someday I'll have to check this 'late binding' everybody talks about....
    Meanwhile... I found a way to solve the problem:
    I save the new files using Worksheets("name").Copy
    That way excel creates a new file that becomes the activeworkbook. So right there I inserted the
    Please Login or Register  to view this content.
    so the new file comes with added reference.
    That way the VBIDE works just fine.
    But thanks again for your time.

+ 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. Programmatically adding a row and renumbering subsequent rows
    By cpmcnamara in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-22-2008, 01:58 PM
  2. Programmatically Searching Formulas for Sheet References
    By Baard in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-28-2007, 09:54 PM
  3. programmatically adding both normal and formatted text into the same cell
    By stef123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-13-2007, 01:08 PM
  4. [SOLVED] Help:Programmatically Adding Checkboxes with Captions
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2006, 03:15 PM
  5. Adding checkboxes programmatically to a worksheet
    By Stef in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-01-2005, 12:06 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